您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
拦截具有特定类名的<div>元素
// ==UserScript== // @name 拦截CUG网页VPN弹窗 // @version 1.0 // @description 拦截具有特定类名的<div>元素 // @match https://webvpn.cug.edu.cn/* // @grant none // @namespace https://greasyfork.org/users/1112554 // ==/UserScript== (function() { 'use strict'; var targetClassNames = [ 'dialog-mask','dialog']; var observer = new MutationObserver(function(mutationsList) { for (var mutation of mutationsList) { if (mutation.type === 'childList') { mutation.addedNodes.forEach(function(node) { if (node.classList && targetClassNames.some(function(className) { return node.classList.contains(className); })) { node.remove(); } }); } } }); observer.observe(document.documentElement, { childList: true, subtree: true }); })();