您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
依用戶ID或內容關鍵字隱藏留言
当前为
// ==UserScript== // @name 巴哈GNN新聞留言屏蔽 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 依用戶ID或內容關鍵字隱藏留言 // @author ryan1992 // @match https://gnn.gamer.com.tw/* // @run-at document-end // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 設定要隱藏留言的用戶ID const targetUserIDs = [ "userID1","userID2" ]; // 設定要隱藏的留言文字關鍵字 const targetKeywords = [ "範例1","範例2" ]; function hideTargetRows() { const rows = document.querySelectorAll(".dynamic-reply__row"); rows.forEach(row => { let hide = false; // 1. 檢查用戶 href const aUser = row.querySelector("a.dynamic-reply-user"); if(aUser){ const href = aUser.href; for(const id of targetUserIDs){ if(href.includes(id)){ hide = true; break; } } } // 2. 檢查留言文字 if(!hide){ const pMsg = row.querySelector("p.dynamic-reply__msg"); if(pMsg){ const text = pMsg.textContent; for(const kw of targetKeywords){ if(text.includes(kw)){ hide = true; break; } } } } if(hide){ row.style.display = "none"; } }); } // 初次隱藏 hideTargetRows(); // 監控動態加載的留言 const observer = new MutationObserver(() => { hideTargetRows(); }); observer.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址