-
Notifications
You must be signed in to change notification settings - Fork 215
/
pornhub_v.js
40 lines (38 loc) · 993 Bytes
/
pornhub_v.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
document.cookie = "views=1";
document.cookie = "atatusScript=hide";
document.cookie = "local_storage=1";
/* 视频页广告加速 */
(function() {
// Based on uAssets
// License: https://github.com/uBlockOrigin/uAssets/blob/master/LICENSE
var z = window.setInterval,
needle = '{{1}}',
delay = parseInt('{{2}}', 10),
boost = parseFloat('{{3}}');
if ( needle === '' || needle === '{{1}}' ) {
needle = '.?';
} else if ( needle.charAt(0) === '/' && needle.slice(-1) === '/' ) {
needle = needle.slice(1, -1);
} else {
needle = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
needle = new RegExp(needle);
if ( isNaN(delay) || !isFinite(delay) ) {
delay = 1000;
}
if ( isNaN(boost) || !isFinite(boost) ) {
boost = 0.05;
}
if ( boost < 0.02 ) {
boost = 0.02;
}
if ( boost > 50 ) {
boost = 50;
}
window.setInterval = function(a, b) {
if ( b === delay && needle.test(a.toString()) ) {
b *= boost;
}
return z.apply(this, arguments);
}.bind(window);
})();