您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
去除NGA论坛广告
当前为
// ==UserScript== // @name NGA-NoAd // @namespace http://tampermonkey.net/ // @version 0.0.2 // @author Githuboy // @description 去除NGA论坛广告 // @license MIT // @require https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js // @match *://bbs.nga.cn/* // @match *://ngabbs.com/* // @match *://nga.178.com/* // @inject-into content // ==/UserScript== (function() { 'use strict'; var id =0; var $ = window.jQuery||{}; //https://bbs.nga.cn/misc/adpage_insert_2.html?5https://bbs.nga.cn/read.php?tid=28126278 var url = window.location.href; if(url.includes("adpage")){ window.location.href=url.substr(url.indexOf("?5")+2); return; } var task = function(){ var adImgs = $("img[src='https://img4.nga.178.com/ngabbs/nga_classic/admark.png']"); var adLength = adImgs.length; if(adLength==0){ clearInterval(id); setTimeout(function(){ id = setInterval(task,100); },1500); return; } console.log("发现广告数量:"+adLength+",执行清理"); $(adImgs).each((i,a)=>{ var p =$(a).parent(); if(p !=null){ $(p).parent().remove(); } else p.remove(); }) }; id = setInterval(task,100); // Your code here... })();