您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
用于关闭 baeldung.com 频繁出现的要求允许广告弹窗
// ==UserScript== // @name 关闭允许广告弹窗 // @namespace https://icexmoon.cn/ // @version 0.3 // @description 用于关闭 baeldung.com 频繁出现的要求允许广告弹窗 // @author [email protected] // @license MIT // @match https://www.baeldung.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=baeldung.com // @grant none // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js // ==/UserScript== let waitMills = 500; let totalCheckTimes = 200; let checkTimes = 0; (function() { 'use strict'; // Your code here... setTimeout(closeADWindow, waitMills); $(document).ready(modifyMainWidth); })(); function modifyMainWidth(){ $("#main:not(:only-child)").css("width","calc(100% - 0px - 3vw)"); } function closeADWindow(){ if(checkTimes >= totalCheckTimes){ console.log("检测循环次数超过最大次数("+totalCheckTimes+"),脚本自动结束。") return; } let closeBtn = document.querySelector("button[tabindex][aria-label=Close]"); if(closeBtn != null){ closeBtn.click(); console.log("弹窗被关闭"); } else{ console.log("未发现广告弹窗"); setTimeout(closeADWindow, waitMills); } checkTimes++; }