Greasy Fork

去他妈的灰色网页

去掉灰色滤镜,让网页恢复正常的颜色

当前为 2022-12-01 提交的版本,查看 最新版本

// ==UserScript==
// @name         去他妈的灰色网页
// @namespace    http://tampermonkey.net/
// @version      0.1
// @license MIT
// @description  去掉灰色滤镜,让网页恢复正常的颜色
// @author       You
// @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; filter: none;} html.removeGray *  {-webkit-filter: none; filter: none;}");
    // Your code here...
})();