网页黑白滤镜

把网页变成黑白色

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

// ==UserScript==
// @name         网页黑白滤镜
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  把网页变成黑白色
// @author       ccav5
// @match        *://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    addNewStyle("*{-webkit-filter: grayscale(100%)}")
})();

function addNewStyle(newStyle) {
    console.log("👴 add new style:", newStyle)
    var styleElement = document.getElementById('styles_js');

    if (!styleElement) {
        styleElement = document.createElement('style');
        styleElement.type = 'text/css';
        styleElement.id = 'styles_js';
        document.getElementsByTagName('head')[0].appendChild(styleElement);
    }

    styleElement.appendChild(document.createTextNode(newStyle));
}

QingJ © 2025

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