Dark theme all pages

Dark theme for all pages

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Dark theme all pages
// @namespace    f97
// @version      1.0
// @description  Dark theme for all pages
// @include *
// @author       f97
// @grant        none
// @run-at document-end
// ==/UserScript==
 
(function() {
    'use strict';
    function crawl(cube){
        var x2; var x3;
        for (x2 = 0;x2 < cube.length; x2++){
          if(cube[x2].nodeType == 1 ){
                if(cube[x2].tagName == "A"){cube[x2].style.color = "#aaaaff"; cube[x2].style.backgroundColor = "#000000";}
                    cube[x2].style.lineHeight = 2; cube[x2].style.color = "#ffffff"; cube[x2].style.backgroundColor = "#333333";
  //Duplicate the line below for additional style changes, such as border colors
  //cube[x2].style.borderColor = "#FFFFFF";
  //cube[x2].style.fontSize = "16pt";// font size
}
            if(cube[x2].hasChildNodes() ){x3 = cube[x2].childNodes; crawl(x3, x3.length);}
        }
    }
function mp1 () {
var x1;
    document.body.style.backgroundColor = "#000000";
    document.body.style.color = "#ffffff";
    x1 = document.body.childNodes;
    crawl(x1);
}
setTimeout(mp1,1000);
})();