// ==UserScript== // @name 任意网站去黑白 // @namespace http://tampermonkey.net/ // @version 2.0 // @description 去除任意网站的黑白样式 // @author share121 // @match *://*/* // @license MIT // @grant none // @homepageURL https://greasyfork.org/zh-CN/scripts/455866 // @supportURL https://greasyfork.org/zh-CN/scripts/455866-%E4%BB%BB%E6%84%8F%E7%BD%91%E7%AB%99%E5%8E%BB%E9%BB%91%E7%99%BD/feedback // @downloadURL none // ==/UserScript== document .querySelector("head") .appendChild(document.createElement("style")).innerText = ".grayToColorful{filter:grayscale(0)!important;-webkit-filter:grayscale(0)!important;-moz-filter:grayscale(0)!important;-ms-filter:grayscale(0)!important;-o-filter:grayscale(0)!important;filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)!important;}"; document.querySelectorAll("*").forEach(function (e) { let s = getComputedStyle(e), g = function (t) { if (!Boolean(t)) { return false; } return /grayscale/i.test(t); }; if ( g(s.filter) || g(s.webkitFilter) || g(s.mozFilter) || g(s.msFilter) || g(s.oFilter) ) { e.classList.add("grayToColorful"); } });