您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Highlights Updates in history tab of Nexus Mods
// ==UserScript== // @name Highlight Updates in History // @namespace http://tampermonkey.net/ // @version 2024-03-26 // @description Highlights Updates in history tab of Nexus Mods // @author TragicNet // @match https://www.nexusmods.com/users/myaccount?tab=download+history // @icon https://www.google.com/s2/favicons?sz=64&domain=nexusmods.com // @grant GM_addStyle // ==/UserScript== function updateDateColors(newColor, oldColor) { let tableRows = document.querySelectorAll('tbody > tr'); tableRows.forEach((row) => { let dlDate = new Date(row.querySelector('td:nth-child(2)').innerHTML); let updateDate = new Date(row.querySelector('td:nth-child(5)').innerHTML); if(dlDate > updateDate) { row.querySelector('td:nth-child(2)').style.color = newColor; } else { row.querySelector('td:nth-child(2)').style.color = oldColor; } }) } window.addEventListener('load', (event) => { // Select the node that will be observed for mutations const targetNode = document.getElementById("tab-my-download-history"); // Options for the observer (which mutations to observe) const config = { childList: true, subtree: true }; // Callback function to execute when mutations are observed const callback = (mutationList, observer) => { updateDateColors('cyan', 'red'); }; // Create an observer instance linked to the callback function const observer = new MutationObserver(callback); // Start observing the target node for configured mutations observer.observe(targetNode, config); });