// ==UserScript== // @name 智能黑暗模式 (1.97 排除版) // @namespace http://tampermonkey.net/ // @version 1.97 // @description 1.9稳定版基础 + 排除原生黑色网站,解决黑变白问题 // @author xxb // @license MIT // @match *://*/* // @exclude *://sleazyfork.org/* // @exclude *://greasyfork.org/* // @exclude *://github.com/* // @grant none // @run-at document-start // @downloadURL https://update.greasyfork.icu/scripts/572008/%E6%99%BA%E8%83%BD%E9%BB%91%E6%9A%97%E6%A8%A1%E5%BC%8F%20%28197%20%E6%8E%92%E9%99%A4%E7%89%88%29.user.js // @updateURL https://update.greasyfork.icu/scripts/572008/%E6%99%BA%E8%83%BD%E9%BB%91%E6%9A%97%E6%A8%A1%E5%BC%8F%20%28197%20%E6%8E%92%E9%99%A4%E7%89%88%29.meta.js // ==/UserScript== (function() { 'use strict'; // 1.95 证明最稳的 CSS 逻辑 const style = document.createElement('style'); style.id = "smart-dark-final"; style.innerHTML = ` html { background-color: #111 !important; filter: invert(90%) hue-rotate(180deg) !important; min-height: 100% !important; } img, video, canvas, iframe, [style*="background-image"], [class*="img"], [class*="thumb"] { filter: invert(100%) hue-rotate(180deg) !important; } /* 保持页头不被重复反转 */ header, nav { filter: none !important; } `; // 直接注入,不进行任何亮度检测(因为有 exclude 排除名单) document.documentElement.appendChild(style); })();