diff --git a/baidu/clearAd.user.js b/baidu/clearAd.user.js index 280a3cf..aa04e13 100644 --- a/baidu/clearAd.user.js +++ b/baidu/clearAd.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name 百度广告去除 // @namespace http://ide.yumc.pw/ -// @version 0.0.3 +// @version 0.0.5 // @description 去除百度上下推广广告 // @author MiaoWoo // @include http*://*.baidu.* @@ -52,8 +52,21 @@ margin-bottom:30px; }); } }); + ['.m', 'a span'].forEach(function (c) { + var result = $(c) + var tempCount = 0 + result.each(function (index,element) { + if($(element).html() == "广告" && $(element).parent().parent().css('display')!='none'){ + $(element).parent().parent().remove(); + tempCount++ + } + if($(element).html() == "评价" && $(element).parent().parent().parent().css('display')!='none'){ + $(element).parent().parent().remove(); + tempCount++ + } + }); + showCount(tempCount); + }) } - setInterval(function () { - clear(); - },500); + setInterval(clear, 500); })(); \ No newline at end of file