您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
blacklist the links from certain boards in the main page.
当前为
// ==UserScript== // @name bdwmBlacklist // @namespace bdwmBlacklist // @description blacklist the links from certain boards in the main page. // @include http://bdwm.net/bbs/main0.php // @version 0.1b // @grant none // ==/UserScript== function rmNodeWithClass(node, classKey) { // remove a node together with its ancestor node // whose class name contains classKey var myNode = node; while (node.className!=null && node.className.indexOf(classKey)<0) { node = node.parentNode; } if (node.className==null) { console.log('error finding class.'); return; } console.log('removing class: '+node.className); node.parentNode.removeChild(node); } function blacklistBoard(boardlist) { console.log('Going to block '+boardlist.length+' boards.'); var keyStr = boardlist.map(function(s){return 'board='+s;}); var links = document.getElementsByTagName('a'); console.log(links.length+' links detected.'); for (var i in links) { console.log('Link: '+links[i].href); for (var j in keyStr) { if (links[i].href.indexOf(keyStr[j])>=0) { console.log('To remove '+links[i].href); rmNodeWithClass(links[i], 'Rank'); break; } } } } blacklistBoard(['Boy', 'SecretGarden', 'PieBridge', 'Triangle', "Joke"]);