您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
hao123首页精简,支持logo自定义
// ==UserScript== // @name hao123首页去广告 // @namespace [email protected] // @version 0.1 // @icon https://i0.hdslb.com/bfs/article/22c554f415718a12b04bd1bd5c0e0d195be382cc.gif // @description hao123首页精简,支持logo自定义 // @author mrnianj // @homepageURL none // @match *://www.hao123.com/* // @grant none // @license none // @require https://code.jquery.com/jquery-3.0.0.min.js // ==/UserScript== (function ($) { 'use strict'; const cycle = 1000*5; // 广告检测周期(毫秒) const firstcycle = 20; // 第一次广告检测周期 let isagain = true; // 是否循环检测 const logurl = 'https://www.bing.com/th/id/OGC.f5fdac42703d2dc3b3b8f3c48040755a?pid=1.7&rurl=https%3a%2f%2fimg.zcool.cn%2fcommunity%2f01fe7e5b20e106a80121bbecefcfbc.gif&ehk=fF7pT%2fA0vVUR4hUSmQXaqPY7057Z6yRGnVcSliYO3Hg%3d';//替换 logo 地址 function myRemove (id){ //$(id).css('display','none'); $(id).remove(); } let classname = [ "#topbeWrapper",//顶部广告 "#lefttip",// 左侧悬浮广告 ".siye",// 右侧顶部广告 ".rightTip",// 右下广告 "#box-famous-resource",// 横幅广告 ".bottom-banner-link-wrapper",// 底部广告 ".wm"// 推荐栏广告 ] let timer = setInterval(() => { $(".hao123logourl img").attr('src',logurl); $.each(classname, function (indexInArray, valueOfElement) { myRemove(valueOfElement) }); clearInterval(timer); if (isagain){ setInterval(() => { $.each(classname, function (indexInArray, valueOfElement) { myRemove(valueOfElement) }); },cycle) } },firstcycle) })(jQuery);