(function() {
'use strict';
document.body.style.filter = 'grayscale(0)';
document.getElementsByTagName('html')[0].style.filter='grayscale(0)';
var nodes = document.all;
for(var n=0;n<nodes.length;n++){
if (nodes[n].style.filter == '') continue;
nodes[n].style.filter = 'grayscale(0)';
}
setInterval(function() {
Fuck();
}, 1000);
var b = false;
b |= noGray(document.body);
b |= noGray("app")
b |= noGray(document.getElementsByTagName("html")[0]);
if (b) return;
for(var i = 0; i < document.styleSheets.length; i++) try {
for (var j = 0; j < document.styleSheets[i].rules.length; j++ ) {
var s = document.styleSheets[i].rules[j].cssText;
if (s.indexOf('filter') >=0 && s.indexOf('grayscale(1') >= 0 && (s.indexOf('body') >=0 || s.indexOf('html') >=0)) {
document.styleSheets[i].disabled = true;
}
}
} catch(e) {
console.log("href: ",document.styleSheets[i].href, "\nmedia: ", document.styleSheets[i].media, "\ntitle: ", document.styleSheets[i].title, "\ntype: ", document.styleSheets[i].type);
}
function Fuck() {
var divs = document.getElementsByTagName("div");
var m = 0;
for (m = 0; m < divs.length; m++) {
noGray(divs[m]);
}
divs = document.getElementsByTagName("main");
for (m = 0; m < divs.length; m++) {
noGray(divs[m]);
}
noGray(document.body);
noGray("app");
noGray(document.getElementsByTagName("html")[0]);
}
function noGray(element) {
try {
var el = (typeof(element) == "string") ? document.getElementById(element) :element;
var old = el.className;
el.className = el.className.replaceAll("gray", "");
el.className = el.className.replaceAll("grew", "");
el.className = el.className.replaceAll("gary", "");
el.style.filter = 'grayscale(0)';
return el.className != old;
} catch(e) {
return false;
}
}
})();