-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdel.js
71 lines (61 loc) · 2.07 KB
/
del.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
64
65
66
67
68
69
70
var paywallSmasher = {
deletePaywall: function() {
smasher = this.getCorrectSmasher();
if(smasher !== null) {
smasher();
}
},
getCorrectSmasher: function() {
href = window.location.href.toString();
if(href.contains('nationalpost') || href.contains('financialpost')) {
return this.smashNationalPost;
} else if(href.contains('thestar')) {
return this.smashTorontoStar;
} else if(href.contains('theonion')) {
return this.smashTheOnion;
} else {
return null;
}
},
smashTorontoStar: function() {
$('#syncronexOverlay').remove();
$('#syncronexOverlayContent').remove();
},
smashTheOnion: function() {
$("#gregbox-outer").remove();
$("#gregbox-signInTab").remove();
$('img').filter(function() {
return $(this).attr('src') === 'http://s.ppjol.net/static/fb/fancy_close.png';
}).remove();
//Slightly less of a hack, still stupid
getElementByXpath('/html/body/div[3]').remove();
},
smashNationalPost: function() {
$("#gregbox-outer").remove();
$("#gregbox-signInTab").remove();
$('img').filter(function() {
return $(this).attr('src') === 'http://s.ppjol.net/static/fb/fancy_close.png';
}).remove();
//Fucking huge hack, OMFG
setTimeout(function() {
getElementByXpath('/html/body/div[5]').remove();
}, 0);
setTimeout(function() {
nextElement = getElementByXpath('/html/body/div[5]');
if (nextElement !== null) {
getElementByXpath('/html/body/div[5]').remove();
}
}, 0);
},
};
String.prototype.contains = function(string) {
return this.indexOf(string) !== -1;
};
var getElementByXpath = function (path) {
return document.evaluate(path, document, null, 9, null).singleNodeValue;
};
window.addEventListener('load', function() {
setTimeout(function() {
paywallSmasher.deletePaywall();
}, 2000);
}, false);