-
Notifications
You must be signed in to change notification settings - Fork 0
/
stoppity.js
53 lines (48 loc) · 1.54 KB
/
stoppity.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
// remove script tags matching the following patterns
var rx1 = new RegExp('wp-content/plugins/pippity');
var rx2 = new RegExp('clickfuse.com');
var sc = window.document.getElementsByTagName('script');
for (scr in sc) {
if (rx1.test(scr.src) || rx2.test(scr.src))
scr.src = '';
}
var classes = [
'popup-dom-lightbox-wrapper', // popup domination
'jqmWindow' // jqm ads
];
var ids = [
'pty_pkg', // pippity poppity
'mod_wrapper', // modal wrapper
'AdSpotMovie', // AdSpot
'shortTail_D30_modal' // short tail
];
var childids = [
'rm_modal', // ringtone maker
];
window.setInterval (function () {
// check for the specified IDs and kill them
for (id=0; id<ids.length; id++) {
var el = window.document.getElementById(ids[id]);
if (el) {
el.parentNode.removeChild(el);
chrome.extension.sendRequest ({'type':ids[id]}, function(response){} );
}
}
// kill anything containing the specified child ID
for (id=0; id<childids.length; id++) {
var el = window.document.getElementById(childids[id]);
if (el) {
el = el.parentNode;
el.parentNode.removeChild(el);
chrome.extension.sendRequest ({'type':childids[id]}, function(response){} );
}
}
// kill anything with the specified CSS class
for (cl=0; cl<classes.length; cl++) {
var nodes = window.document.getElementsByClassName(classes[cl]);
for (i=0; i<nodes.length; i++) {
nodes[i].parentNode.removeChild(nodes[i]);
chrome.extension.sendRequest ({'type':classes[cl]}, function(response){} );
}
}
}, 500);