您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces Hacker News comment text with "AI" if it contains the word "AI"
当前为
// ==UserScript== // @name HackerNews_AI_Comment_Replace // @match https://news.ycombinator.com/item* // @description Replaces Hacker News comment text with "AI" if it contains the word "AI" // @version 0.0.1.20251003165023 // @namespace https://greasyfork.org/users/1435046 // ==/UserScript== const observeComments = () => { const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { mutation.addedNodes.forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE) { const commentElements = node.querySelectorAll('div.commtext.c00'); commentElements.forEach((commentElement) => { const commentText = commentElement.textContent; if (commentText.includes('AI')) { commentElement.textContent = 'AI'; } }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); }; observeComments();