您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
torn.com No Dark Text - Removes all dark text in the forum, so it's readable in dark mode
当前为
// ==UserScript== // @name torn.com No dark text in forum // @namespace xentac // @version 20250408.1 // @description torn.com No Dark Text - Removes all dark text in the forum, so it's readable in dark mode // @author xentac [3354782] // @match *.torn.com/forums.php* // @license MIT // ==/UserScript== "use strict"; function removeDarkStyling(node) { //console.log(node); if (node.querySelectorAll) { var spans = node.querySelectorAll(".post span"); for (var i = 0; i < spans.length; i++) { const elem = spans[i]; // TODO: Write a better color parser. Everything below a certain RGB value should be nulled if (elem.style.color == "rgb(51, 51, 51)") { elem.style.color = null; } else if (elem.style.color == "var(--te-text-color-gray5)") { elem.style.color = null; } else if (elem.style.color == "rgb(0, 0, 0)") { elem.style.color = null; } else if (elem.style.color == "black") { elem.style.color = null; } } } } function react(mutation) { mutation.addedNodes.forEach(removeDarkStyling); } function reactAll(mutations) { mutations.forEach(react); } (function () { const target = document.querySelector("#forums-page-wrap"); removeDarkStyling(target); const observer = new MutationObserver(reactAll); observer.observe(target, { childList: true, subtree: true }); //observer.disconnect(); })();