From fb3f6d65dc356e35cd14c536f3127dce9158bddf Mon Sep 17 00:00:00 2001 From: JackieZheng Date: Tue, 26 Dec 2017 17:12:41 +0800 Subject: [PATCH] Update Kill Baidu AD.user.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重新修改代码,追加代码写在最后,经过傲游、360、chrome测试OK --- Kill Baidu AD/Kill Baidu AD.user.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Kill Baidu AD/Kill Baidu AD.user.js b/Kill Baidu AD/Kill Baidu AD.user.js index d06c5dd5e72..b58859eb94f 100644 --- a/Kill Baidu AD/Kill Baidu AD.user.js +++ b/Kill Baidu AD/Kill Baidu AD.user.js @@ -69,4 +69,20 @@ } } setTimeout(()=>{clearAD();},2000); -})(); \ No newline at end of file +})(); +//2017-12-26 重新修改代码,追加代码写在最后,经过傲游、360、chrome测试OK +// 移除搜索结果头部"广告" #shadow-root ppim id=1 +document.addEventListener('DOMSubtreeModified',function(){ + //傲游保留 + Array.prototype.forEach.call(document.body.querySelectorAll(".c-container /deep/ .c-container"), function(e) { + e.parentNode.removeChild(e); + }); + //chrome系列 + Array.prototype.forEach.call(document.body.querySelectorAll(".m"), function(e) { + if(e.innerText=='广告') + { + e=e.parentNode.parentNode; + e.parentNode.removeChild(e); + } + }); +},false);