网页黑白滤镜

把网页变成黑白色

目前为 2023-07-06 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 网页黑白滤镜
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description 把网页变成黑白色
  6. // @author ccav5
  7. // @match *://*/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. addNewStyle("*{-webkit-filter: grayscale(100%)}")
  14. })();
  15.  
  16. function addNewStyle(newStyle) {
  17. console.log("👴 add new style:", newStyle)
  18. var styleElement = document.getElementById('styles_js');
  19.  
  20. if (!styleElement) {
  21. styleElement = document.createElement('style');
  22. styleElement.type = 'text/css';
  23. styleElement.id = 'styles_js';
  24. document.getElementsByTagName('head')[0].appendChild(styleElement);
  25. }
  26.  
  27. styleElement.appendChild(document.createTextNode(newStyle));
  28. }

QingJ © 2025

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