Greasy Fork 还支持 简体中文。

Anti-Grayscale

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

Fra 11.04.2020. Se den seneste versjonen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Anti-Grayscale
// @namespace    https://github.com/xcanwin/
// @version      0.3.5
// @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';
	var filterstyle, re = /grayscale\(.*?\)/gi;
	["filter", "-webkit-filter", "-moz-filter", "-ms-filter", "-o-filter"].forEach(xcanwin => {
		Array.prototype.forEach.call(document.getElementsByTagName("*"), function(el) {
			filterstyle = document.defaultView.getComputedStyle(el, null)[xcanwin];
			if (filterstyle && filterstyle.match(re)) {
				el.style = xcanwin + ": " + filterstyle.replace(re, "grayscale(0) !important");
			}
		});
	});
})();