// ==UserScript== // @name 樱花动漫去广告 // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description 去除樱花动漫侧边广告 // @author jackpapapapa // @include http://www.yhdm.so/* // @require https://code.jquery.com/jquery-3.6.0.min.js // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; console.log('start') var start_time = new Date().getTime(); var restart_time = 200; var max_run_time = 5000; function wait_call(choose_id,callback){ var val = setInterval(()=>{ var choose = $(choose_id) //console.log(choose) if(new Date().getTime() - start_time>max_run_time){clearInterval(val)} if(choose.length>0){ callback(choose_id); clearInterval(val); } },restart_time) } var ad_list = ['#HMcoupletDivleft','#HMcoupletDivright','#HMRichBox'] wait_call(ad_list, (ad)=>{ for(let ad of ad_list){ $(ad).remove(); console.log('Successfully remove', ad) } }) })();