Greasy Fork is available in English.

绿色护眼模式

将网页的背景颜色更改为绿色

// ==UserScript==
// @name         绿色护眼模式
// @namespace    https://viayoo.com/
// @version      2.0
// @description  将网页的背景颜色更改为绿色
// @author       回村的诱惑
// @license      AGPL-3.0-or-later
// @icon         https://i.postimg.cc/cJssHLNZ/Dofoto-20240626-143646591b40b3a70bff0499d10ba9da08d5fc60c.png
// @run-at       document-start
// @match        *
// @grant        none
// ==/UserScript==

! function() {
const k = '(0, 0, 0,';
function hanlde(){
let arr = document.getElementsByTagName("*");
for (var i = 0; i < arr.length; i++) {
let item = arr[i];
let computedStyle = document.defaultView.getComputedStyle(item, "");
if (item.tagName != 'IMG' && computedStyle.backgroundColor.indexOf(k) == -1 && computedStyle.background.indexOf(k) == -1) {
item.style.backgroundColor = '#C7EDCC';
} else {
console.log(computedStyle.backgroundColor);
}
}
}
hanlde();
var clientHeight = document.body.clientHeight;
var b = new window.MutationObserver(function(b) {
console.log(document.body.clientHeight);
if(document.body.clientHeight>clientHeight){
hanlde()
}
});
b.observe(document, {
childList: !0,
subtree: !0
})
}()