Greasy Fork

Greasy Fork is available in English.

智能黑暗模式 (1.97 排除版)

1.9稳定版基础 + 排除原生黑色网站,解决黑变白问题

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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
// ==/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);
})();