去掉灰色滤镜,让网页恢复正常的颜色
// ==UserScript==
// @name 去他妈的灰色网页
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @license MIT
// @description 去掉灰色滤镜,让网页恢复正常的颜色
// @author Ihurryup
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @grant none
// ==/UserScript==
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
function addNewStyle(newStyle) {
var styleElement = document.getElementById('styles_js');
if (!styleElement) {
styleElement = document.createElement('style');
styleElement.type = 'text/css';
styleElement.id = 'styles_js';
document.getElementsByTagName('head')[0].appendChild(styleElement);
}
styleElement.appendChild(document.createTextNode(newStyle));
}
(function() {
'use strict';
document.querySelector("html").classList.add("removeGray")
addNewStyle("html.removeGray {-webkit-filter: none!important; -moz-filter:none!important; -ms-filter:none!important; filter: none!important;} html.removeGray * {-webkit-filter: none!important; -moz-filter:none!important; -ms-filter:none!important; filter: none!important;}");
// Your code here...
})();