Anti-Grayscale

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

目前為 2020-04-06 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Anti-Grayscale
  3. // @namespace https://github.com/xcanwin/
  4. // @version 0.3.4
  5. // @description 移除页面的灰色模式 (恢复页面的彩色模式). Remove grayscale of html page (Restore color mode of html page).
  6. // @author xcanwin
  7. // @license MIT
  8. // @supportURL https://github.com/xcanwin/Anti-Grayscale/
  9. // @match *://*/*
  10. // @grant all
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var filterstyle, re = /grayscale\(.*?\)/gi;
  16. ["filter", "-webkit-filter", "-moz-filter", "-ms-filter", "-o-filter"].forEach(xcanwin => {
  17. Array.prototype.forEach.call(document.getElementsByTagName("*"), function(el) {
  18. filterstyle = document.defaultView.getComputedStyle(el, null)[xcanwin];
  19. if (filterstyle.match(re)){
  20. el.style = xcanwin + ": " + filterstyle.replace(re, "grayscale(0) !important");
  21. }
  22. });
  23. });
  24. })();

QingJ © 2025

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