// ==UserScript== // @name 黑白网页恢复彩色 // @namespace http://tampermonkey.net/ // @version 1.4.5 // @license MIT // @description 黑白网页恢复彩色,匹配所有网页,即装即用。 // @author https://greasyfork.org/users/574395-frammolz-amanda // @match *://*/* // @grant none // @downloadURL none // ==/UserScript== (function() { var filter = document.createElement('style'); filter.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(filter); filter.appendChild(document.createTextNode("*{-webkit-filter:none!important;}")); var windowUrl = window.location.href; var baidudesk = /https:\/\/www.baidu.com/; var baidumobile = /https:\/\/m.baidu.com/; var kafan = /https:\/\/bbs.kafan.cn/; var qpic = /https:\/\/www.58pic.com/; if( windowUrl.match(baidudesk)){ document.getElementById("s_lg_img").setAttribute("src","https://www.baidu.com/img/flexible/logo/pc/index.png"); document.getElementById("s_lg_img_new").setAttribute("src","https://www.baidu.com/img/flexible/logo/pc/index.png"); document.getElementById("su").style.setProperty("background-color","#4e6ef2","important"); if (document.getElementsByClassName("index-logo-src").length==1){ document.getElementsByClassName("index-logo-src")[0].setAttribute("src","https://www.baidu.com/img/flexible/logo/pc/result.png"); document.getElementsByClassName("index-logo-peak")[0].setAttribute("src","https://www.baidu.com/img/flexible/logo/pc/result.png"); document.getElementsByClassName("index-logo-srcnew")[0].setAttribute("src","https://www.baidu.com/img/flexible/logo/pc/result.png"); } } if( windowUrl.match(baidumobile)){ document.getElementById("logo").getElementsByTagName("a")[0].getElementsByTagName("img")[0].setAttribute("src","https://www.baidu.com/img/flexible/logo/logo_web.png"); document.getElementById("index-bn").style.setProperty("background-color","#4e6ef2","important"); } if( windowUrl.match(kafan)){ document.getElementById("nv_forum").style.setProperty("background-blend-mode","normal"); } if( windowUrl.match(qpic)){ document.documentElement.style.setProperty("-webkit-filter","none","important"); } })();