-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean_baidu.js
63 lines (48 loc) · 1.39 KB
/
clean_baidu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
if(window.location.host.indexOf('baidu') > -1 ) {
var flag = false;
var keywords = ['广告'];
function removeAd() {
$('#content_right').hide();
$('#rs').hide();
$('#rs_top_new').hide();
each_keyword(function(key){
$.each($("span"), function(idx, e){
if( $(e).html().indexOf(key) > -1 ) {
find_parent(e, function(c, p) {
if(p.id == 'content_left') {
$(c).remove();
removed +=1;
return true;
} else {
return false;
}
});
}
});
});
}
removeAd();
setInterval(function(){
removeAd();
}, 100);
if(flag) {
// $('<span/>').text(",已經過濾掉令人反感的商蛆。").appendTo($('#resultStats'));
}
}
/*
var kw = $('#kw');
var form = $('#form');
chrome.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
alert("shit");
if (request.action == "send") {
kw.val(request.keyword)
sendResponse({state:'关键词填写成功!'});
}
if (request.action == "submit") {
form.submit();
sendResponse({state:'提交成功!'});
}
}
);
*/