Skip to content

Commit 1d20f60

Browse files
committed
fix
1 parent 5899808 commit 1d20f60

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Kill Baidu AD/Kill Baidu AD.user.js

Lines changed: 12 additions & 5 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.5
5+
// @version 0.6
66
// @description Just Kill Baidu AD
77
// @description:zh-CN 彻底清理百度搜索(www.baidu.com)结果首尾的推广广告、二次顽固广告与右侧广告,并防止反复
88
// @author hoothin
@@ -31,11 +31,18 @@
3131
};
3232
observer.observe(document.body, option);
3333

34-
var mAd=document.querySelector(".ec_wise_ad");
35-
if(mAd)mAd.parentNode.removeChild(mAd);
34+
delMobileAD();
35+
36+
function delMobileAD(){
37+
var mAds=document.querySelectorAll(".ec_wise_ad,.ec_youxuan_card");
38+
for(var i=0;i<mAds.length;i++){
39+
var mAd=mAds[i];
40+
mAd.parentNode.removeChild(mAd);
41+
}
42+
}
43+
3644
function clearAD(){
37-
var mAd=document.querySelector(".ec_wise_ad");
38-
if(mAd)mAd.parentNode.removeChild(mAd);
45+
delMobileAD();
3946
var list=document.body.querySelectorAll("#content_left>div,#content_left>table"),i;
4047
for(i=0;i<list.length;i++){
4148
let item = list[i];

0 commit comments

Comments
 (0)