2ccc屏蔽关键词元素_1_帖子列表回复

通过元素选择来找到key.

// ==UserScript==
// @name         2ccc屏蔽关键词元素_1_帖子列表回复
// @namespace    http://bbs.2ccc.com/topic.asp?topicid=630046
// @version      0.1
// @description  通过元素选择来找到key.
// @author       You
// @match        *://bbs.2ccc.com/
// @match        *://bbs.2ccc.com/?pageno=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=2ccc.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
	'use strict';
	var robot_name = "(tuhemm|nihaosv|mikhop)";

	var findtable = document.querySelector("body > table:nth-child(6) > tbody > tr > td:nth-child(3)"); //列出所有 帖子
	for (var i = 0; i < findtable.childElementCount; i++) {
		if (findtable.children[i].className == 'child') {
			var findtable2 = findtable.children[i].querySelector("table > tbody"); //所有的回复tr
			for (var j = 0; j < findtable2.childElementCount; j++) {
				let robot_name_exist = findtable2.children[j].innerHTML.search(robot_name) > 0;
				if (robot_name_exist) {
					findtable2.children[j].style.display = "none";
				}

			}
		}



	}

	// Your code here...
})();