Skip to content

Commit 66efe43

Browse files
committed
fix
1 parent b62d52f commit 66efe43

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

Kill Baidu AD/Kill Baidu AD.user.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Kill Baidu AD
33
// @name:zh-CN 百度广告(首尾推广及右侧广告)清理
44
// @namespace hoothin
5-
// @version 0.6
5+
// @version 0.7
66
// @description Just Kill Baidu AD
77
// @description:zh-CN 彻底清理百度搜索(www.baidu.com)结果首尾的推广广告、二次顽固广告与右侧广告,并防止反复
88
// @author hoothin
@@ -23,7 +23,6 @@
2323
'use strict';
2424
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
2525
var observer = new MutationObserver(function(records){
26-
delMobileAD();
2726
clearAD();
2827
});
2928
var option = {
@@ -32,18 +31,13 @@
3231
};
3332
observer.observe(document.body, option);
3433

35-
delMobileAD();
36-
37-
function delMobileAD(){
38-
var mAds=document.querySelectorAll(".ec_wise_ad,.ec_youxuan_card");
39-
for(var i=0;i<mAds.length;i++){
34+
function clearAD(){
35+
var mAds=document.querySelectorAll(".ec_wise_ad,.ec_youxuan_card"),i;
36+
for(i=0;i<mAds.length;i++){
4037
var mAd=mAds[i];
4138
mAd.remove();
4239
}
43-
}
44-
45-
function clearAD(){
46-
var list=document.body.querySelectorAll("#content_left>div,#content_left>table"),i;
40+
var list=document.body.querySelectorAll("#content_left>div,#content_left>table");
4741
for(i=0;i<list.length;i++){
4842
let item = list[i];
4943
let s = item.getAttribute("style");

0 commit comments

Comments
 (0)