// ==UserScript==
// @name 绿色护眼模式
// @namespace https://viayoo.com/
// @version 0.1
// @homepageURL https://app.viayoo.com/addons/4
// @author 回村的诱惑
// @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
})
}()


Back to home | File page

Subscribe | Register | Login | N