您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Filters spam messages from Nostr chatbox based on specified pattern - Tested with Chromium
// ==UserScript== // @name Violentmonkey - Nostr.ch Chatbox Filter // @namespace NostrChatboxFilter // @version 1.1 // @description Filters spam messages from Nostr chatbox based on specified pattern - Tested with Chromium // @author gourcetools // @match https://nostr.ch/* // @license MIT // ==/UserScript== (function() { 'use strict'; function hideMessages() { // Define the patterns to hide const patternsToHide = ['lightning', 'chatgpt', 'free sats', 'nokyc']; // Select all message boxes const messageBoxes = document.querySelectorAll('.mbox'); // Iterate through the message boxes messageBoxes.forEach((messageBox) => { // Get the message text const messageText = messageBox.innerText.toLowerCase(); // Check if the message contains any of the patterns to hide const shouldHide = patternsToHide.some((pattern) => messageText.includes(pattern)); // Hide the message if it contains any of the patterns to hide if (shouldHide) { messageBox.style.display = 'none'; } }); } setInterval(hideMessages, 1000); })();