// ==UserScript== // @name 明亮,白底,黑字 // @namespace https://greasyfork.org/users/1171320 // @version 0.1 // @description 页面保持明亮模式,(除标题外)将加粗文本恢复正常大小,白底黑字。 // @author yzcjd // @author2 Lama AI 辅助 // @match *://*/* // @run-at document-end // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 确保选择明亮模式 const setLightMode = () => { document.documentElement.style.filter = 'invert(0)'; document.documentElement.style.backgroundColor = 'white'; }; // 将加粗文本恢复成正常颜色 const normalizeBoldText = () => { const boldElements = document.querySelectorAll('b, strong'); boldElements.forEach(element => { element.style.color = 'inherit'; element.style.fontWeight = 'normal'; }); }; // 将所有非标题文字的字体颜色改为黑色 const setTextToBlack = () => { const allTextElements = document.querySelectorAll('p, span, li, div'); allTextElements.forEach(element => { const computedStyle = window.getComputedStyle(element); if (!computedStyle.fontSize.includes('h1') && !computedStyle.fontSize.includes('h2') && !computedStyle.fontSize.includes('h3') && !computedStyle.fontSize.includes('h4') && !computedStyle.fontSize.includes('h5') && !computedStyle.fontSize.includes('h6')) { element.style.color = 'black'; } }); }; // 执行调整 setLightMode(); normalizeBoldText(); setTextToBlack(); })();