您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Highlight my incidents/changes
// ==UserScript== // @name ServiceNow - Highlight Assigned to Me // @version 0.4.1 // @license MIT // @description Highlight my incidents/changes // @author Ricardo Constantino // @match https://*.service-now.com/change_request_list.do* // @match https://*.service-now.com/incident_list.do* // @match https://*.service-now.com/rm_story_list.do* // @grant none // @namespace https://gf.qytechs.cn/users/129739 // ==/UserScript== (function() { 'use strict'; const STYLE = ` tr.assignedToMe td { background-color: #bcefff !important; } tr.assignedToMe.updatedByNotMe td { background-color: #ffe686 !important; } `; const IGNORE_SYSTEM_UPDATES = true; let assignedToColumn = document.querySelector('th[name="assigned_to"]'); if (!assignedToColumn) return; let assignedToColumnIdx = [...assignedToColumn.parentElement.children].indexOf(assignedToColumn); let meSysID = g_user.getUserID(); let meUserName = g_user.getUserName(); let d = document.createElement('style'); d.textContent = STYLE; document.querySelector("style").append(d); let tableElem = assignedToColumn.parentElement.parentElement.parentElement; let rowsAssignedToMe = [...tableElem.querySelectorAll('td:nth-child('+(assignedToColumnIdx+1)+')')] .filter(e => e.children.length > 0 && e.children[0].getAttribute('sys_id') === meSysID) .map(c => c.parentElement); rowsAssignedToMe.forEach(r => r.addClassName('assignedToMe')); let updatedByColumn = tableElem.querySelector('th[name="sys_updated_by"]'); if (updatedByColumn) { let updatedByColumnIdx = [...updatedByColumn.parentElement.children].indexOf(updatedByColumn); rowsAssignedToMe .filter(r => r.children[updatedByColumnIdx].textContent !== meUserName && (!IGNORE_SYSTEM_UPDATES || r.children[updatedByColumnIdx].textContent !== 'system')) .forEach(r => r.addClassName('updatedByNotMe')); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址