您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动隐藏带[绿文]标签(而不是标题内容)的帖子
当前为
// ==UserScript== // @name 搜书小组(404吧)-刘备小说版块 “绿文”标签过滤器 // @namespace https://greasyfork.org/zh-CN/users/1441970-%E5%8D%97%E7%AB%B9 // @version 0.2 // @description 自动隐藏带[绿文]标签(而不是标题内容)的帖子 // @author 南竹 // @match https://404zu.com/* // @match https://404zu.com/forum.php?mod=forumdisplay&fid=* // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; // 核心过滤逻辑 function filterGreenPosts() { // 遍历所有帖子行(根据实际结构调整选择器) document.querySelectorAll('tbody[id^="normalthread_"] tr').forEach(row => { // 定位到包含标签的 <em> 元素 const tagElem = row.querySelector('th.common em'); if (tagElem) { const tagText = tagElem.textContent.trim(); // 判断是否包含"绿文"标签 if (tagText.includes('[绿文]')) { row.style.display = 'none'; // 隐藏整行 } } }); } // 动态加载监听(优化性能) const observer = new MutationObserver(mutations => { mutations.forEach(m => { if (m.addedNodes.length) { setTimeout(filterGreenPosts, 300); // 防抖处理 } }); }); observer.observe(document.body, { childList: true, subtree: true }); // 初始执行 window.addEventListener('load', () => { setTimeout(filterGreenPosts, 1000); // 等待页面加载 }); })();