// ==UserScript== // @name 2012portal 白昼模式 // @namespace https://viayoo.com/ // @version 1.4 // @license MIT // @description 白昼模式 + 全站链接无下滑线 + 蓝色链接一致风格,可菜单开/关。 // @author ChatGPT // @match https://2012portal.blogspot.com/* // @match http://2012portal.blogspot.com/* // @grant GM_registerMenuCommand // @grant GM_getValue // @grant GM_setValue // @run-at document-start // ==/UserScript== ;(function(){ 'use strict'; const STORAGE_KEY = 'PortalDayModeEnabled'; let enabled = GM_getValue(STORAGE_KEY, true); function toggleDayMode(){ enabled = !enabled; GM_setValue(STORAGE_KEY, enabled); location.reload(); } GM_registerMenuCommand( enabled ? '✖ 禁用 白昼模式' : '✔ 启用 白昼模式', toggleDayMode ); if (!enabled) return; const css = ` /* —— 白底黑字基础(除链接外) —— */ html, body, *:not(a), *:not(a) * { background: #fff !important; color: #000 !important; filter: none !important; mix-blend-mode: normal !important; text-shadow: none !important; } /* —— 全站链接统一蓝色,强制取消下划线 —— */ a, a * { color: #06c !important; text-decoration: none !important; } /* —— 针对链接四个状态的颜色和下划线清除 —— */ a:link, a:visited, a:hover, a:active { color: #06c !important; text-decoration: none !important; } /* —— 避免 ineffective 的继承规则 —— */ [class*="dark"] a, [id*="dark"] a, .night a { color: #06c !important; text-decoration: none !important; } /* —— 代码块与引用仍设为浅底黑字 —— */ pre, code, blockquote, .highlight { background: #f4f4f4 !important; color: #000 !important; } `.trim(); const style = document.createElement('style'); style.textContent = css; (document.head || document.documentElement).appendChild(style); })();