将网页显示为黑白效果
当前为
// ==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));
}