您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name filter hkepc banned reply // @namespace http://tampermonkey.net/ // @version 0.2 // @description try to take over the world! // @author You // @match https://www.hkepc.com/forum/viewthread.php?* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... var found = false; var banList = [ { id: 'carl.20150508'}, { id: 'yipyipfung'} ]; do { found = false; var quoteList = document.getElementsByClassName("quote"); for (var i = 0; i < quoteList.length; i++) { for (var j = 0; j < banList.length; j++ ) { var myRe = new RegExp('\\n'+banList[j].id+'.*發表於', 'ig'); if (myRe.exec(quoteList[i].innerText)) { var parent = quoteList[i].parentNode; parent.removeChild(quoteList[i]); found = true; } } } } while (found); do { found = false; var postList = document.getElementById("postlist"); for (var i = 0; i < postList.childNodes.length; i++) { var authorString = postList.childNodes[i].getElementsByClassName("postauthor")[0].innerText.replace(/\n.*/gi,""); for (var j = 0; j < banList.length; j++ ) { if (banList[j].id == authorString) { postList.removeChild(postList.childNodes[i]); found = true; } } } } while (found); })();