您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the dark custom CSS theme from subverses on VOAT.com
当前为
- // ==UserScript==
- // @name Remove custom css on VOAT
- // @include https://voat.co/*
- // @include https://www.voat.co/*
- // @description Removes the dark custom CSS theme from subverses on VOAT.com
- // @version 1.0
- // @author wOxxOm
- // @namespace wOxxOm.scripts
- // @license MIT License
- // @run-at document-start
- // @grant none
- // ==/UserScript==
- setMutationHandler(document, '#custom_css', function(observer, nodes) {
- [].forEach.call(nodes, function(node) { node.remove() });
- if (!observer.stopped)
- (function() {
- document.addEventListener("DOMContentLoaded", function() {
- observer.disconnect();
- observer.stopped = true;
- });
- })();
- return true;
- });
- function setMutationHandler(baseNode, selector, cb) {
- var ob = new MutationObserver(function(mutations){
- for (var i=0, ml=mutations.length, m; (i<ml) && (m=mutations[i]); i++)
- for (var j=0, nodes=m.addedNodes, nl=nodes.length, n; (j<nl) && (n=nodes[j]); j++)
- if (n.nodeType == 1)
- if ((n = n.matches(selector) ? [n] : n.querySelectorAll(selector)) && n.length)
- if (!cb(ob, n))
- return;
- });
- ob.observe(baseNode, {subtree:true, childList:true});
- }