您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
根据F12查找到的element名称,对其进行自动屏蔽的通用脚本,*****请注意第15~17行*****,自行修改需要屏蔽的网站和内容(现在的blockeName和blockedPageUrls是用来屏蔽嘶哩嘶哩的悬浮窗广告的)
当前为
// ==UserScript== // @name Block Element by Name // @namespace http://tampermonkey.net/ // @version 1.14 // @description 根据F12查找到的element名称,对其进行自动屏蔽的通用脚本,*****请注意第15~17行*****,自行修改需要屏蔽的网站和内容(现在的blockeName和blockedPageUrls是用来屏蔽嘶哩嘶哩的悬浮窗广告的) // @author chatGPT生成的=。= // @match http://*/* // @match https://*/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Configure the blocked element name and page URLs here | 在下面输入你不想看到的element名称和包含它们的页面,在浏览器中按F12可以很容易找到。 var blockName = ['coupletleft','coupletright','HMRichBox']; // Change to the name of the element to be blocked var blockedPageUrls = ['https://www.silisili.tv/', 'http://www.example.org/']; // Check if the current page URL matches one of the blockedPageUrls function isBlockedPageUrl() { for (var i = 0; i < blockedPageUrls.length; i++) { if (window.location.href.indexOf(blockedPageUrls[i]) !== -1) { return true; } } return false; } // Block elements with the specified name function blockElementsByName(name) { var elements = document.getElementsByTagName('*'); for(var i=0; i<elements.length; i++) { if(elements[i].getAttribute('name') === name) { elements[i].style.display = 'none'; } } } // Main script logic if (isBlockedPageUrl()) { blockElementsByName(blockName); } })();