// ==UserScript== // @name 移除百度推广和广告内容 // @namespace http://tampermonkey.net/ // @version 1.8 // @author iemsauce3 // @description 移除烦人和可能不确信的推广及广告(小浮窗监视屏蔽数量,可手动关闭) // @match *://www.baidu.com/* // @downloadURL none // ==/UserScript== //---------------------------------------------------------- var tgTotal=0, ggTotal=0; removeTimes=0; $(document).ready(function(){ if(window.location.href.indexOf('baidu.com')<0)return; $('#wrapper_wrapper').before(`
关闭浮窗

已过滤 0
「广告+推广」

`); setTimeout(function(){ removePre(); },1000); $('#su').click(function(){ removePre(); }); $('.page-inner').find('a').click(function(){ console.log('span.pc parent'); removePre(); }); $('#closeView').click(function(){ $(this).parent().hide(); }); }); var removePre = function(){ //每次手动按“搜索”后广告移除次数阀值清零 removeTimes = 0; adsInterval = setInterval(function(){ console.log('search click remove'); removeTimes++; removeAds(); },1000); } var removeAds = function(){ var rs=''; var content = $('#content_left'); // console.log(content); var tuiguang = content.find('.ec-tuiguang'); // console.log(tuiguang); if(tuiguang.length>0){ tgTotal+=tuiguang.length; for(var i=0;i10){ clearInterval(adsInterval); removeTimes = 0; } }