// ==UserScript==
// @name 移除百度推广和广告内容
// @namespace http://tampermonkey.net/
// @version 1.3
// @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(`
`);
setTimeout(function(){
console.log('ready remove');
removeAds();
},2000);
$('#su').click(function(){
//每次手动按“搜索”后广告移除次数阀值清零
removeTimes = 0;
adsInterval = setInterval(function(){
console.log('search click remove');
removeTimes++;
removeAds();
},1000);
});
$('#closeView').click(function(){
$(this).parent().hide();
});
});
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;i3)clearInterval(adsInterval);
}