From 928e2f8ddc602314a62e4b614520436711a8c85e Mon Sep 17 00:00:00 2001 From: 502647092 Date: Tue, 8 Jan 2019 15:01:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'baidu/clearAd.user.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baidu/clearAd.user.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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