您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
沪江词典去除首尾广告
// ==UserScript== // @name 沪江去除广告脚本 // @name:zh 沪江词典去广告 // @description:zh-cn 沪江词典去除首尾广告 // @namespace Violentmonkey Scripts // @match http://www.hjdict.com/* // @author Tin Kyoku // @create 2019-11-13 // @grant none // @version 1.1 // @run-at document-end // @namespace http://tampermonkey.net/ // @license GPL-3.0-only // @description 沪江词典去除首尾广告 // ==/UserScript== window.onload = function(){ var reg = new RegExp(/^[_]{1}[a-zA-Z0-9]{7,12}$/); isExistReg(); if ($('.ad').length > 0) { $('.ad').remove(); } else { console.log("element has been removed"); } function isExistReg(){ for(i=0;i<50;i++){ var tempStr = $("div").eq(i).attr("id"); if(typeof(tempStr)=="undefined"){ continue; } else { if(reg.test(tempStr)){ //console.log(tempStr); $("#"+tempStr).remove(); }else{ //console.log("BUG"); } } } } };