Greasy Fork

Greasy Fork is available in English.

❤黑白网页恢复❤

需要恢复的网页按照下面的格式加入进来就行

当前为 2022-11-30 提交的版本,查看 最新版本

// ==UserScript==
// @name         ❤黑白网页恢复❤
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description   需要恢复的网页按照下面的格式加入进来就行
// @match        *://tieba.baidu.com/*
// @match        *://www.taobao.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=baidu.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    var abc = document.createElement('style');
    abc.type = 'text/css';
    abc.id='huifu'
    document.getElementsByTagName('head')[0].appendChild(abc);//加入到head中
    abc.appendChild(document.createTextNode("*{-webkit-filter:grayscale(0)}"));
    abc.appendChild(document.createTextNode("*{-webkit-filter:none!important;}"));
    abc.appendChild(document.createTextNode("*{-ot-filter:none!important;}"));
    abc.appendChild(document.createTextNode("*{-moz-filter:none!important;}"));
    abc.appendChild(document.createTextNode("*{-ms-filter:none!important;}"));

    window.onload=function(){
     var abcd =document.createElement('div');
     abcd.id='fuzhi';
     abcd.textContent='黑白';
     document.getElementsByTagName('body')[0].appendChild(abcd);
     var xxx=document.createElement('style');
     xxx.type = 'text/css';
     xxx.innerText='#fuzhi{padding: 10px; background: rgba(0,0,0,0.5);position: fixed; left:0; top: 40%;cursor: pointer;color: #fff; z-index: 99999;}';
     document.getElementsByTagName('head')[0].appendChild(xxx)
     abcd.onclick=function(){
      var ddd=document.getElementById('huifu');
          ddd.innerText='';
     }
    }
        document.addEventListener("DOMContentLoaded", function () {

    })
})();