Anti-Grayscale

移除页面的灰色模式(恢复页面的彩色模式). Remove grayscale of html page (Restore color mode of html page).

目前为 2020-04-05 提交的版本。查看 最新版本

// ==UserScript==
// @name         Anti-Grayscale
// @namespace    https://github.com/xcanwin/
// @version      0.3.3
// @description  移除页面的灰色模式(恢复页面的彩色模式). Remove grayscale of html page (Restore color mode of html page).
// @author       xcanwin
// @license      MIT
// @supportURL   https://github.com/xcanwin/Anti-Grayscale/
// @match        *://*/*
// @grant        all
// ==/UserScript==

(function() {
	'use strict';
	["filter", "-webkit-filter", "-moz-filter", "-ms-filter", "-o-filter"].forEach(xcanwin => {
		Array.prototype.forEach.call(document.getElementsByTagName("*"), function(el) {
			el.style[xcanwin] = document.defaultView.getComputedStyle(el, null)[xcanwin].replace(/grayscale\(.*?\)/gi, "grayscale(0)");
		});
	});
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址