code
stringlengths 24
2.07M
| docstring
stringlengths 25
85.3k
| func_name
stringlengths 1
92
| language
stringclasses 1
value | repo
stringlengths 5
64
| path
stringlengths 4
172
| url
stringlengths 44
218
| license
stringclasses 7
values |
---|---|---|---|---|---|---|---|
function addListenerById(id, funx, time) {
setTimeout(() => {
var eleById = document.getElementById(id);
eleById.addEventListener("click", funx, false)
}, time)
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
addListenerById
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function loopq() {
alert("Got it!")
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
loopq
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function tagName_appendChild(tagname, url, where) {
const ele_New = document.createElement(tagname);
// script
if (tagname == "script") {
ele_New.type = "text/javascript";
ele_New.src = url;
ele_New.setAttribute('async', '')
// link
} else if (tagname == "link") {
ele_New.rel = "stylesheet";
ele_New.type = "text/css";
ele_New.href = url;
}
if (where == "body") {
document.body.appendChild(ele_New);
} else if (where == "head") {
document.head.appendChild(ele_New);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
tagName_appendChild
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function button_dynamicRemove(selector, times) {
var initCount = 0;
var loop = setInterval(() => {
var ele = document.querySelectorAll(selector);
if (ele.length > 0) {
ele[0].click()
}
initCount += 1;
if (initCount == times) {
clearInterval(loop);
}
}, 0)
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
button_dynamicRemove
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function m3u8_tempt(x) {
var i, url_result; var url_regex = new RegExp(x, "gi")
var ele = ["script", "a"];
var ele_catch = document.querySelectorAll(ele);
for (i = 0; i < ele_catch.length; i++) {
if ((url_result = url_regex.exec(ele_catch[i].innerHTML)) != null) {
document.getElementById("copy").value = url_result;
console.log("Catch it")
}
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
m3u8_tempt
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function pornhub_sidebar_ads() {
setTimeout(() => {
var ele_parent = ["div"];
var ele_children = ["img[data-title][title][srcset]"];
var ele_attributes = ["class"];
var i;
const css_Selctors = document.querySelectorAll(ele_parent);
for (i = 0; i < css_Selctors.length; i++) {
if (css_Selctors[i].querySelectorAll(ele_children).length !== 0) {
if (css_Selctors[i].getAttribute(ele_attributes)) {
if (css_Selctors[i].attributes.length == 1) {
if (css_Selctors[i].children.length == 2) {
console.log(css_Selctors[i])
css_Selctors[i].style.display = "none";
}
}
}
}
}
}, 500);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
pornhub_sidebar_ads
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function _91porn_videoplay_ads() {
//setTimeout(() => {
var ele_parent = ["div"];
var ele_children = ["a[target=\"_blank\"] > img[src*=\".gif\"]"];
var i;
const css_Selctors = document.querySelectorAll(ele_parent);
for (i = 0; i < css_Selctors.length; i++) {
if (css_Selctors[i].querySelectorAll(ele_children).length !== 0) {
if (css_Selctors[i].attributes.length == 0) {
if (css_Selctors[i].children.length == 9) {
console.log(css_Selctors[i])
css_Selctors[i].style.display = "none";
}
}
}
}
//}, 500);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
_91porn_videoplay_ads
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function tag_ads_traversal(selector, i) {
const css_Selctors = document.querySelectorAll(selector)
css_Selctors[i].style.display = "none";
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
tag_ads_traversal
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
}
return "";
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
getCookie
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function window_open_defuser() {
'use strict';
let arg1 = '{{1}}';
if (arg1 === '{{1}}') { arg1 = ''; }
let arg2 = '{{2}}';
if (arg2 === '{{2}}') { arg2 = ''; }
let arg3 = '{{3}}';
if (arg3 === '{{3}}') { arg3 = ''; }
const log = /\blog\b/.test(arg3)
? console.log.bind(console)
: () => { };
const newSyntax = /^[01]?$/.test(arg1) === false;
let pattern = '';
let targetResult = true;
let autoRemoveAfter = -1;
if (newSyntax) {
pattern = arg1;
if (pattern.startsWith('!')) {
targetResult = false;
pattern = pattern.slice(1);
}
autoRemoveAfter = parseInt(arg2);
if (isNaN(autoRemoveAfter)) {
autoRemoveAfter = -1;
}
} else {
pattern = arg2;
if (arg1 === '0') {
targetResult = false;
}
}
if (pattern === '') {
pattern = '.?';
} else if (/^\/.+\/$/.test(pattern)) {
pattern = pattern.slice(1, -1);
} else {
pattern = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
const rePattern = new RegExp(pattern);
const createDecoy = function (tag, urlProp, url) {
const decoy = document.createElement(tag);
decoy[urlProp] = url;
decoy.style.setProperty('height', '1px', 'important');
decoy.style.setProperty('position', 'fixed', 'important');
decoy.style.setProperty('top', '-1px', 'important');
decoy.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoy);
setTimeout(() => decoy.remove(), autoRemoveAfter * 1000);
return decoy;
};
window.open = new Proxy(window.open, {
apply: function (target, thisArg, args) {
log('window.open:', ...args);
const url = args[0];
if (rePattern.test(url) !== targetResult) {
return target.apply(thisArg, args);
}
if (autoRemoveAfter < 0) { return null; }
const decoy = /\bobj\b/.test(arg3)
? createDecoy('object', 'data', url)
: createDecoy('iframe', 'src', url);
let popup = decoy.contentWindow;
if (typeof popup === 'object' && popup !== null) {
Object.defineProperty(popup, 'closed', { value: false });
} else {
const noopFunc = (function () { }).bind(self);
popup = new Proxy(self, {
get: function (target, prop) {
if (prop === 'closed') { return false; }
const r = Reflect.get(...arguments);
if (typeof r === 'function') { return noopFunc; }
return target[prop];
},
set: function () {
return Reflect.set(...arguments);
},
});
}
if (/\blog\b/.test(arg3)) {
popup = new Proxy(popup, {
get: function (target, prop) {
log('window.open / get', prop, '===', target[prop]);
return Reflect.get(...arguments);
},
set: function (target, prop, value) {
log('window.open / set', prop, '=', value);
return Reflect.set(...arguments);
},
});
}
return popup;
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
window_open_defuser
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoy = document.createElement(tag);
decoy[urlProp] = url;
decoy.style.setProperty('height', '1px', 'important');
decoy.style.setProperty('position', 'fixed', 'important');
decoy.style.setProperty('top', '-1px', 'important');
decoy.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoy);
setTimeout(() => decoy.remove(), autoRemoveAfter * 1000);
return decoy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoy = document.createElement(tag);
decoy[urlProp] = url;
decoy.style.setProperty('height', '1px', 'important');
decoy.style.setProperty('position', 'fixed', 'important');
decoy.style.setProperty('top', '-1px', 'important');
decoy.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoy);
setTimeout(() => decoy.remove(), autoRemoveAfter * 1000);
return decoy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function setConstant(
chain = '',
cValue = ''
) {
if (typeof chain !== 'string') { return; }
if (chain === '') { return; }
const trappedProp = (() => {
const pos = chain.lastIndexOf('.');
if (pos === -1) { return chain; }
return chain.slice(pos + 1);
})();
if (trappedProp === '') { return; }
const thisScript = document.currentScript;
const objectDefineProperty = Object.defineProperty.bind(Object);
const cloakFunc = fn => {
objectDefineProperty(fn, 'name', { value: trappedProp });
const proxy = new Proxy(fn, {
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
},
});
return proxy;
};
if (cValue === 'undefined') {
cValue = undefined;
} else if (cValue === 'false') {
cValue = false;
} else if (cValue === 'true') {
cValue = true;
} else if (cValue === 'null') {
cValue = null;
} else if (cValue === "''") {
cValue = '';
} else if (cValue === '[]') {
cValue = [];
} else if (cValue === '{}') {
cValue = {};
} else if (cValue === 'noopFunc') {
cValue = cloakFunc(function () { });
} else if (cValue === 'trueFunc') {
cValue = cloakFunc(function () { return true; });
} else if (cValue === 'falseFunc') {
cValue = cloakFunc(function () { return false; });
} else if (/^\d+$/.test(cValue)) {
cValue = parseFloat(cValue);
if (isNaN(cValue)) { return; }
if (Math.abs(cValue) > 0x7FFF) { return; }
} else {
return;
}
let aborted = false;
const mustAbort = function (v) {
if (aborted) { return true; }
aborted =
(v !== undefined && v !== null) &&
(cValue !== undefined && cValue !== null) &&
(typeof v !== typeof cValue);
return aborted;
};
// https://github.com/uBlockOrigin/uBlock-issues/issues/156
// Support multiple trappers for the same property.
const trapProp = function (owner, prop, configurable, handler) {
if (handler.init(owner[prop]) === false) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if (odesc instanceof Object) {
owner[prop] = cValue;
if (odesc.get instanceof Function) {
prevGetter = odesc.get;
}
if (odesc.set instanceof Function) {
prevSetter = odesc.set;
}
}
try {
objectDefineProperty(owner, prop, {
configurable,
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
});
} catch (ex) {
}
};
const trapChain = function (owner, chain) {
const pos = chain.indexOf('.');
if (pos === -1) {
trapProp(owner, chain, false, {
v: undefined,
init: function (v) {
if (mustAbort(v)) { return false; }
this.v = v;
return true;
},
getter: function () {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function (a) {
if (mustAbort(a) === false) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
const v = owner[prop];
chain = chain.slice(pos + 1);
if (v instanceof Object || typeof v === 'object' && v !== null) {
trapChain(v, chain);
return;
}
trapProp(owner, prop, true, {
v: undefined,
init: function (v) {
this.v = v;
return true;
},
getter: function () {
return this.v;
},
setter: function (a) {
this.v = a;
if (a instanceof Object) {
trapChain(a, chain);
}
}
});
};
trapChain(window, chain);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setConstant
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
cloakFunc = fn => {
objectDefineProperty(fn, 'name', { value: trappedProp });
const proxy = new Proxy(fn, {
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
},
});
return proxy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
cloakFunc
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
cloakFunc = fn => {
objectDefineProperty(fn, 'name', { value: trappedProp });
const proxy = new Proxy(fn, {
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
},
});
return proxy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
cloakFunc
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
defineProperty
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
deleteProperty
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
mustAbort = function (v) {
if (aborted) { return true; }
aborted =
(v !== undefined && v !== null) &&
(cValue !== undefined && cValue !== null) &&
(typeof v !== typeof cValue);
return aborted;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
mustAbort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
mustAbort = function (v) {
if (aborted) { return true; }
aborted =
(v !== undefined && v !== null) &&
(cValue !== undefined && cValue !== null) &&
(typeof v !== typeof cValue);
return aborted;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
mustAbort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
trapProp = function (owner, prop, configurable, handler) {
if (handler.init(owner[prop]) === false) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if (odesc instanceof Object) {
owner[prop] = cValue;
if (odesc.get instanceof Function) {
prevGetter = odesc.get;
}
if (odesc.set instanceof Function) {
prevSetter = odesc.set;
}
}
try {
objectDefineProperty(owner, prop, {
configurable,
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
});
} catch (ex) {
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapProp
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
trapProp = function (owner, prop, configurable, handler) {
if (handler.init(owner[prop]) === false) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if (odesc instanceof Object) {
owner[prop] = cValue;
if (odesc.get instanceof Function) {
prevGetter = odesc.get;
}
if (odesc.set instanceof Function) {
prevSetter = odesc.set;
}
}
try {
objectDefineProperty(owner, prop, {
configurable,
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
});
} catch (ex) {
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapProp
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
trapChain = function (owner, chain) {
const pos = chain.indexOf('.');
if (pos === -1) {
trapProp(owner, chain, false, {
v: undefined,
init: function (v) {
if (mustAbort(v)) { return false; }
this.v = v;
return true;
},
getter: function () {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function (a) {
if (mustAbort(a) === false) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
const v = owner[prop];
chain = chain.slice(pos + 1);
if (v instanceof Object || typeof v === 'object' && v !== null) {
trapChain(v, chain);
return;
}
trapProp(owner, prop, true, {
v: undefined,
init: function (v) {
this.v = v;
return true;
},
getter: function () {
return this.v;
},
setter: function (a) {
this.v = a;
if (a instanceof Object) {
trapChain(a, chain);
}
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapChain
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
trapChain = function (owner, chain) {
const pos = chain.indexOf('.');
if (pos === -1) {
trapProp(owner, chain, false, {
v: undefined,
init: function (v) {
if (mustAbort(v)) { return false; }
this.v = v;
return true;
},
getter: function () {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function (a) {
if (mustAbort(a) === false) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
const v = owner[prop];
chain = chain.slice(pos + 1);
if (v instanceof Object || typeof v === 'object' && v !== null) {
trapChain(v, chain);
return;
}
trapProp(owner, prop, true, {
v: undefined,
init: function (v) {
this.v = v;
return true;
},
getter: function () {
return this.v;
},
setter: function (a) {
this.v = a;
if (a instanceof Object) {
trapChain(a, chain);
}
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapChain
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function evaldataPrune() {
window.eval = new Proxy(eval, {
apply: (a, b, c) => {
if (c[0] && c[0].includes("commercial") && c[0].startsWith("(") && c[0].endsWith(")")) { let a = c[0].slice(1).slice(0, -1), b = JSON.parse(a); b.entity?.commercial && (b.entity.commercial = void 0), c[0] = `(${JSON.stringify(b)})` }
return Reflect.apply(a, b, c)
}
})
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
evaldataPrune
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function abortCurrentInlineScript(source, property, search) {
const searchRegexp = toRegExp(search);
const rid = randomId();
const SRC_DATA_MARKER = 'data:text/javascript;base64,';
const getCurrentScript = () => {
if ('currentScript' in document) {
return document.currentScript;
}
const scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
};
const ourScript = getCurrentScript();
const abort = () => {
const scriptEl = getCurrentScript();
if (!scriptEl) {
return;
}
let content = scriptEl.textContent;
// We are using Node.prototype.textContent property descriptor
// to get the real script content
// even when document.currentScript.textContent is replaced.
// https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991
try {
const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;
content = textContentGetter.call(scriptEl);
} catch (e) { } // eslint-disable-line no-empty
// https://github.com/AdguardTeam/Scriptlets/issues/130
if (content.length === 0
&& typeof scriptEl.src !== 'undefined'
&& scriptEl.src?.startsWith(SRC_DATA_MARKER)) {
const encodedContent = scriptEl.src.slice(SRC_DATA_MARKER.length);
content = window.atob(encodedContent);
}
if (scriptEl instanceof HTMLScriptElement
&& content.length > 0
&& scriptEl !== ourScript
&& searchRegexp.test(content)) {
hit(source);
throw new ReferenceError(rid);
}
};
const setChainPropAccess = (owner, property) => {
const chainInfo = getPropertyInChain(owner, property);
let { base } = chainInfo;
const { prop, chain } = chainInfo;
// The scriptlet might be executed before the chain property has been created
// (for instance, document.body before the HTML body was loaded).
// In this case we're checking whether the base element exists or not
// and if not, we simply exit without overriding anything.
// e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092
if (base instanceof Object === false && base === null) {
const props = property.split('.');
const propIndex = props.indexOf(prop);
const baseName = props[propIndex - 1];
const message = `The scriptlet had been executed before the ${baseName} was loaded.`;
logMessage(source, message);
return;
}
if (chain) {
const setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
};
Object.defineProperty(owner, prop, {
get: () => base,
set: setter,
});
return;
}
let currentValue = base[prop];
let origDescriptor = Object.getOwnPropertyDescriptor(base, prop);
if (origDescriptor instanceof Object === false
|| origDescriptor.get instanceof Function === false) {
currentValue = base[prop];
origDescriptor = undefined;
}
const descriptorWrapper = Object.assign(getDescriptorAddon(), {
currentValue,
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
},
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
},
});
setPropertyAccess(base, prop, {
// Call wrapped getter and setter to keep isAbortingSuspended & isolateCallback values
get() {
return descriptorWrapper.get.call(descriptorWrapper);
},
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
},
});
};
setChainPropAccess(window, property);
window.onerror = createOnErrorHandler(rid).bind();
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
abortCurrentInlineScript
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
getCurrentScript = () => {
if ('currentScript' in document) {
return document.currentScript;
}
const scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
getCurrentScript
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
getCurrentScript = () => {
if ('currentScript' in document) {
return document.currentScript;
}
const scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
getCurrentScript
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
abort = () => {
const scriptEl = getCurrentScript();
if (!scriptEl) {
return;
}
let content = scriptEl.textContent;
// We are using Node.prototype.textContent property descriptor
// to get the real script content
// even when document.currentScript.textContent is replaced.
// https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991
try {
const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;
content = textContentGetter.call(scriptEl);
} catch (e) { } // eslint-disable-line no-empty
// https://github.com/AdguardTeam/Scriptlets/issues/130
if (content.length === 0
&& typeof scriptEl.src !== 'undefined'
&& scriptEl.src?.startsWith(SRC_DATA_MARKER)) {
const encodedContent = scriptEl.src.slice(SRC_DATA_MARKER.length);
content = window.atob(encodedContent);
}
if (scriptEl instanceof HTMLScriptElement
&& content.length > 0
&& scriptEl !== ourScript
&& searchRegexp.test(content)) {
hit(source);
throw new ReferenceError(rid);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
abort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
abort = () => {
const scriptEl = getCurrentScript();
if (!scriptEl) {
return;
}
let content = scriptEl.textContent;
// We are using Node.prototype.textContent property descriptor
// to get the real script content
// even when document.currentScript.textContent is replaced.
// https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991
try {
const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;
content = textContentGetter.call(scriptEl);
} catch (e) { } // eslint-disable-line no-empty
// https://github.com/AdguardTeam/Scriptlets/issues/130
if (content.length === 0
&& typeof scriptEl.src !== 'undefined'
&& scriptEl.src?.startsWith(SRC_DATA_MARKER)) {
const encodedContent = scriptEl.src.slice(SRC_DATA_MARKER.length);
content = window.atob(encodedContent);
}
if (scriptEl instanceof HTMLScriptElement
&& content.length > 0
&& scriptEl !== ourScript
&& searchRegexp.test(content)) {
hit(source);
throw new ReferenceError(rid);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
abort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
setChainPropAccess = (owner, property) => {
const chainInfo = getPropertyInChain(owner, property);
let { base } = chainInfo;
const { prop, chain } = chainInfo;
// The scriptlet might be executed before the chain property has been created
// (for instance, document.body before the HTML body was loaded).
// In this case we're checking whether the base element exists or not
// and if not, we simply exit without overriding anything.
// e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092
if (base instanceof Object === false && base === null) {
const props = property.split('.');
const propIndex = props.indexOf(prop);
const baseName = props[propIndex - 1];
const message = `The scriptlet had been executed before the ${baseName} was loaded.`;
logMessage(source, message);
return;
}
if (chain) {
const setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
};
Object.defineProperty(owner, prop, {
get: () => base,
set: setter,
});
return;
}
let currentValue = base[prop];
let origDescriptor = Object.getOwnPropertyDescriptor(base, prop);
if (origDescriptor instanceof Object === false
|| origDescriptor.get instanceof Function === false) {
currentValue = base[prop];
origDescriptor = undefined;
}
const descriptorWrapper = Object.assign(getDescriptorAddon(), {
currentValue,
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
},
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
},
});
setPropertyAccess(base, prop, {
// Call wrapped getter and setter to keep isAbortingSuspended & isolateCallback values
get() {
return descriptorWrapper.get.call(descriptorWrapper);
},
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
},
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setChainPropAccess
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
setChainPropAccess = (owner, property) => {
const chainInfo = getPropertyInChain(owner, property);
let { base } = chainInfo;
const { prop, chain } = chainInfo;
// The scriptlet might be executed before the chain property has been created
// (for instance, document.body before the HTML body was loaded).
// In this case we're checking whether the base element exists or not
// and if not, we simply exit without overriding anything.
// e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092
if (base instanceof Object === false && base === null) {
const props = property.split('.');
const propIndex = props.indexOf(prop);
const baseName = props[propIndex - 1];
const message = `The scriptlet had been executed before the ${baseName} was loaded.`;
logMessage(source, message);
return;
}
if (chain) {
const setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
};
Object.defineProperty(owner, prop, {
get: () => base,
set: setter,
});
return;
}
let currentValue = base[prop];
let origDescriptor = Object.getOwnPropertyDescriptor(base, prop);
if (origDescriptor instanceof Object === false
|| origDescriptor.get instanceof Function === false) {
currentValue = base[prop];
origDescriptor = undefined;
}
const descriptorWrapper = Object.assign(getDescriptorAddon(), {
currentValue,
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
},
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
},
});
setPropertyAccess(base, prop, {
// Call wrapped getter and setter to keep isAbortingSuspended & isolateCallback values
get() {
return descriptorWrapper.get.call(descriptorWrapper);
},
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
},
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setChainPropAccess
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setter
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setter
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
get() {
return descriptorWrapper.get.call(descriptorWrapper);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function addEventListener_defuser() {
let needle1 = '{{1}}';
if (needle1 === '' || needle1 === '{{1}}') {
needle1 = '.?';
} else if (/^\/.+\/$/.test(needle1)) {
needle1 = needle1.slice(1, -1);
} else {
needle1 = needle1.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
needle1 = new RegExp(needle1);
let needle2 = '{{2}}';
if (needle2 === '' || needle2 === '{{2}}') {
needle2 = '.?';
} else if (/^\/.+\/$/.test(needle2)) {
needle2 = needle2.slice(1, -1);
} else {
needle2 = needle2.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
needle2 = new RegExp(needle2);
self.EventTarget.prototype.addEventListener = new Proxy(
self.EventTarget.prototype.addEventListener,
{
apply: function (target, thisArg, args) {
let type, handler;
try {
type = String(args[0]);
handler = String(args[1]);
} catch (ex) {
}
if (
needle1.test(type) === false ||
needle2.test(handler) === false
) {
return target.apply(thisArg, args);
}
}
}
);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
addEventListener_defuser
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function noWindowOpenIf(
pattern = '',
delay = '',
decoy = ''
) {
const safe = safeSelf();
const targetMatchResult = pattern.startsWith('!') === false;
if (targetMatchResult === false) {
pattern = pattern.slice(1);
}
const rePattern = safe.patternToRegex(pattern);
let autoRemoveAfter = parseInt(delay);
if (isNaN(autoRemoveAfter)) {
autoRemoveAfter = -1;
}
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
const logLevel = shouldLog(extraArgs);
const createDecoy = function (tag, urlProp, url) {
const decoyElem = document.createElement(tag);
decoyElem[urlProp] = url;
decoyElem.style.setProperty('height', '1px', 'important');
decoyElem.style.setProperty('position', 'fixed', 'important');
decoyElem.style.setProperty('top', '-1px', 'important');
decoyElem.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoyElem);
setTimeout(() => { decoyElem.remove(); }, autoRemoveAfter * 1000);
return decoyElem;
};
window.open = new Proxy(window.open, {
apply: function (target, thisArg, args) {
const haystack = args.join(' ');
if (logLevel) {
safe.uboLog('window.open:', haystack);
}
if (rePattern.test(haystack) !== targetMatchResult) {
return Reflect.apply(target, thisArg, args);
}
if (autoRemoveAfter < 0) { return null; }
const decoyElem = decoy === 'obj'
? createDecoy('object', 'data', ...args)
: createDecoy('iframe', 'src', ...args);
let popup = decoyElem.contentWindow;
if (typeof popup === 'object' && popup !== null) {
Object.defineProperty(popup, 'closed', { value: false });
} else {
const noopFunc = (function () { }).bind(self);
popup = new Proxy(self, {
get: function (target, prop) {
if (prop === 'closed') { return false; }
const r = Reflect.get(...arguments);
if (typeof r === 'function') { return noopFunc; }
return target[prop];
},
set: function () {
return Reflect.set(...arguments);
},
});
}
if (logLevel) {
popup = new Proxy(popup, {
get: function (target, prop) {
safe.uboLog('window.open / get', prop, '===', target[prop]);
return Reflect.get(...arguments);
},
set: function (target, prop, value) {
safe.uboLog('window.open / set', prop, '=', value);
return Reflect.set(...arguments);
},
});
}
return popup;
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
noWindowOpenIf
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoyElem = document.createElement(tag);
decoyElem[urlProp] = url;
decoyElem.style.setProperty('height', '1px', 'important');
decoyElem.style.setProperty('position', 'fixed', 'important');
decoyElem.style.setProperty('top', '-1px', 'important');
decoyElem.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoyElem);
setTimeout(() => { decoyElem.remove(); }, autoRemoveAfter * 1000);
return decoyElem;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoyElem = document.createElement(tag);
decoyElem[urlProp] = url;
decoyElem.style.setProperty('height', '1px', 'important');
decoyElem.style.setProperty('position', 'fixed', 'important');
decoyElem.style.setProperty('top', '-1px', 'important');
decoyElem.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoyElem);
setTimeout(() => { decoyElem.remove(); }, autoRemoveAfter * 1000);
return decoyElem;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limbo.user.10.15.2023.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limbo.user.10.15.2023.js
|
MIT
|
function uBlockOrigin_add() {
js_adsRemove(uBlockOrigin.chn0abortcurrentscript);
js_adsRemove(uBlockOrigin.chn0setconstant);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abortcurrentscript);
js_adsRemove(uBlockOrigin.abortonpropertyread);
js_adsRemove(uBlockOrigin.abortonpropertywrite);
js_adsRemove(uBlockOrigin.abortonstacktrace);
js_adsRemove(uBlockOrigin.addEventListenerdefuser);
js_adsRemove(uBlockOrigin.alertbuster);
js_adsRemove(uBlockOrigin.cookieremover);
js_adsRemove(uBlockOrigin.disablenewtablinks);
js_adsRemove(uBlockOrigin.evaldataprune);
js_adsRemove(uBlockOrigin.jsonprune);
js_adsRemove(uBlockOrigin.m3uprune);
js_adsRemove(uBlockOrigin.nanosetIntervalbooster);
js_adsRemove(uBlockOrigin.nanosetTimeoutbooster);
js_adsRemove(uBlockOrigin.noevalif);
js_adsRemove(uBlockOrigin.nofetchif);
js_adsRemove(uBlockOrigin.norequestAnimationFrameif);
js_adsRemove(uBlockOrigin.nosetIntervalif);
js_adsRemove(uBlockOrigin.nosetTimeoutif);
js_adsRemove(uBlockOrigin.nowebrtc);
js_adsRemove(uBlockOrigin.nowindowopenif);
js_adsRemove(uBlockOrigin.noxhrif);
js_adsRemove(uBlockOrigin.refreshdefuser);
js_adsRemove(uBlockOrigin.removeattr);
js_adsRemove(uBlockOrigin.removeclass);
js_adsRemove(uBlockOrigin.removenodetext);
js_adsRemove(uBlockOrigin.replacenodetext);
js_adsRemove(uBlockOrigin.setattr);
js_adsRemove(uBlockOrigin.setconstant);
js_adsRemove(uBlockOrigin.setcookie);
js_adsRemove(uBlockOrigin.setlocalstorageitem);
js_adsRemove(uBlockOrigin.spoofcss);
js_adsRemove(uBlockOrigin.trustedsetconstant);
js_adsRemove(uBlockOrigin.trustedsetcookie);
js_adsRemove(uBlockOrigin.windowcloseif);
js_adsRemove(uBlockOrigin.xmlprune);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
uBlockOrigin_add
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function pornhub_interstitialPass() {
const ele_skip = "[onclick*='clearModalCookie']"
const exist = document.querySelectorAll(ele_skip);
if (document.querySelectorAll(ele_skip).length > 0) {
const href = exist[1].href;
window.location = href;
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
pornhub_interstitialPass
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function _18comic_adsRemove() {
document.cookie = "cover=1";
document.cookie = "shunt=1";
document.cookie = "guide=1";
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
_18comic_adsRemove
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function missAv_adsRemove() {
document.cookie = "_gat_UA-177787578-7; expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
missAv_adsRemove
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function set_cookie(name, value) {
document.cookie = name + '=' + value + '; Path=/;';
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set_cookie
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function selector_adsRemove(selector, time) {
var i;
setTimeout(() => {
var nodelists = document.querySelectorAll(selector)
for (i = 0; i < nodelists.length; i++) {
//nodelists[i].remove();
nodelists[i].style = "display:none ! important;"
}
}, time)
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
selector_adsRemove
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function tag_adsRemove(tagname, keyword) {
var i;
var tag = document.getElementsByTagName(tagname);
for (i = 0; i < tag.length; i++) {
if (tag[i].src.indexOf(keyword) !== -1) {
tag[i].remove()
}
if (tag[i].innerHTML.indexOf(keyword) !== -1) {
tag[i].remove()
}
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
tag_adsRemove
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function cloudflare_captchaBypass() {
var title = document.title;
if (title.search("Cloudflare") >= 0 || title.search("Attention") >= 0) {
window.location.reload();
console.log("captchaBypass done;")
};
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
cloudflare_captchaBypass
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function video_loopPlay(x) {
if (x === 'loop') {
intval = window.setInterval(missAv_playbutton, 1000)
} else if (x === 'pause') {
if (intval) {
timerlist.forEach((item, index) => {
clearInterval(item);
})
video_pause();
}
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
video_loopPlay
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function fullscreen() {
const fullScreen = document.querySelector('button[data-plyr=\'fullscreen\']');
fullScreen.click()
//fullScreen.requestFullscreen();
//const fullScreen = document.querySelector('div.plyr__video-wrapper');
//fullScreen.requestFullscreen();
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
fullscreen
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function addListener(selector, funx) {
setTimeout(() => {
var ele = document.querySelectorAll(selector);
for (let index = 0; index < ele.length; index++) {
ele[index].addEventListener("click", funx, false)
}
}, 1000)
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
addListener
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function addListenerById(id, funx, time) {
setTimeout(() => {
var eleById = document.getElementById(id);
eleById.addEventListener("click", funx, false)
}, time)
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
addListenerById
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function loopq() {
alert("Got it!")
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
loopq
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function tagName_appendChild(tagname, url, where) {
const ele_New = document.createElement(tagname);
// script
if (tagname == "script") {
ele_New.type = "text/javascript";
ele_New.src = url;
ele_New.setAttribute('async', '')
// link
} else if (tagname == "link") {
ele_New.rel = "stylesheet";
ele_New.type = "text/css";
ele_New.href = url;
}
if (where == "body") {
document.body.appendChild(ele_New);
} else if (where == "head") {
document.head.appendChild(ele_New);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
tagName_appendChild
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function button_dynamicRemove(selector, times) {
var initCount = 0;
var loop = setInterval(() => {
var ele = document.querySelectorAll(selector);
if (ele.length > 0) {
ele[0].click()
}
initCount += 1;
if (initCount == times) {
clearInterval(loop);
}
}, 0)
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
button_dynamicRemove
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function m3u8_tempt(x) {
var i, url_result; var url_regex = new RegExp(x, "gi")
var ele = ["script", "a"];
var ele_catch = document.querySelectorAll(ele);
for (i = 0; i < ele_catch.length; i++) {
if ((url_result = url_regex.exec(ele_catch[i].innerHTML)) != null) {
document.getElementById("copy").value = url_result;
console.log("Catch it")
}
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
m3u8_tempt
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function pornhub_sidebar_ads() {
setTimeout(() => {
var ele_parent = ["div"];
var ele_children = ["img[data-title][title][srcset]"];
var ele_attributes = ["class"];
var i;
const css_Selctors = document.querySelectorAll(ele_parent);
for (i = 0; i < css_Selctors.length; i++) {
if (css_Selctors[i].querySelectorAll(ele_children).length !== 0) {
if (css_Selctors[i].getAttribute(ele_attributes)) {
if (css_Selctors[i].attributes.length == 1) {
if (css_Selctors[i].children.length == 2) {
console.log(css_Selctors[i])
css_Selctors[i].style.display = "none";
}
}
}
}
}
}, 500);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
pornhub_sidebar_ads
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function _91porn_videoplay_ads() {
//setTimeout(() => {
var ele_parent = ["div"];
var ele_children = ["a[target=\"_blank\"] > img[src*=\".gif\"]"];
var i;
const css_Selctors = document.querySelectorAll(ele_parent);
for (i = 0; i < css_Selctors.length; i++) {
if (css_Selctors[i].querySelectorAll(ele_children).length !== 0) {
if (css_Selctors[i].attributes.length == 0) {
if (css_Selctors[i].children.length == 9) {
console.log(css_Selctors[i])
css_Selctors[i].style.display = "none";
}
}
}
}
//}, 500);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
_91porn_videoplay_ads
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function tag_ads_traversal(selector, i) {
const css_Selctors = document.querySelectorAll(selector)
css_Selctors[i].style.display = "none";
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
tag_ads_traversal
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
}
return "";
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
getCookie
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function window_open_defuser() {
'use strict';
let arg1 = '{{1}}';
if (arg1 === '{{1}}') { arg1 = ''; }
let arg2 = '{{2}}';
if (arg2 === '{{2}}') { arg2 = ''; }
let arg3 = '{{3}}';
if (arg3 === '{{3}}') { arg3 = ''; }
const log = /\blog\b/.test(arg3)
? console.log.bind(console)
: () => { };
const newSyntax = /^[01]?$/.test(arg1) === false;
let pattern = '';
let targetResult = true;
let autoRemoveAfter = -1;
if (newSyntax) {
pattern = arg1;
if (pattern.startsWith('!')) {
targetResult = false;
pattern = pattern.slice(1);
}
autoRemoveAfter = parseInt(arg2);
if (isNaN(autoRemoveAfter)) {
autoRemoveAfter = -1;
}
} else {
pattern = arg2;
if (arg1 === '0') {
targetResult = false;
}
}
if (pattern === '') {
pattern = '.?';
} else if (/^\/.+\/$/.test(pattern)) {
pattern = pattern.slice(1, -1);
} else {
pattern = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
const rePattern = new RegExp(pattern);
const createDecoy = function (tag, urlProp, url) {
const decoy = document.createElement(tag);
decoy[urlProp] = url;
decoy.style.setProperty('height', '1px', 'important');
decoy.style.setProperty('position', 'fixed', 'important');
decoy.style.setProperty('top', '-1px', 'important');
decoy.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoy);
setTimeout(() => decoy.remove(), autoRemoveAfter * 1000);
return decoy;
};
window.open = new Proxy(window.open, {
apply: function (target, thisArg, args) {
log('window.open:', ...args);
const url = args[0];
if (rePattern.test(url) !== targetResult) {
return target.apply(thisArg, args);
}
if (autoRemoveAfter < 0) { return null; }
const decoy = /\bobj\b/.test(arg3)
? createDecoy('object', 'data', url)
: createDecoy('iframe', 'src', url);
let popup = decoy.contentWindow;
if (typeof popup === 'object' && popup !== null) {
Object.defineProperty(popup, 'closed', { value: false });
} else {
const noopFunc = (function () { }).bind(self);
popup = new Proxy(self, {
get: function (target, prop) {
if (prop === 'closed') { return false; }
const r = Reflect.get(...arguments);
if (typeof r === 'function') { return noopFunc; }
return target[prop];
},
set: function () {
return Reflect.set(...arguments);
},
});
}
if (/\blog\b/.test(arg3)) {
popup = new Proxy(popup, {
get: function (target, prop) {
log('window.open / get', prop, '===', target[prop]);
return Reflect.get(...arguments);
},
set: function (target, prop, value) {
log('window.open / set', prop, '=', value);
return Reflect.set(...arguments);
},
});
}
return popup;
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
window_open_defuser
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoy = document.createElement(tag);
decoy[urlProp] = url;
decoy.style.setProperty('height', '1px', 'important');
decoy.style.setProperty('position', 'fixed', 'important');
decoy.style.setProperty('top', '-1px', 'important');
decoy.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoy);
setTimeout(() => decoy.remove(), autoRemoveAfter * 1000);
return decoy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoy = document.createElement(tag);
decoy[urlProp] = url;
decoy.style.setProperty('height', '1px', 'important');
decoy.style.setProperty('position', 'fixed', 'important');
decoy.style.setProperty('top', '-1px', 'important');
decoy.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoy);
setTimeout(() => decoy.remove(), autoRemoveAfter * 1000);
return decoy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function setConstant(
chain = '',
cValue = ''
) {
if (typeof chain !== 'string') { return; }
if (chain === '') { return; }
const trappedProp = (() => {
const pos = chain.lastIndexOf('.');
if (pos === -1) { return chain; }
return chain.slice(pos + 1);
})();
if (trappedProp === '') { return; }
const thisScript = document.currentScript;
const objectDefineProperty = Object.defineProperty.bind(Object);
const cloakFunc = fn => {
objectDefineProperty(fn, 'name', { value: trappedProp });
const proxy = new Proxy(fn, {
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
},
});
return proxy;
};
if (cValue === 'undefined') {
cValue = undefined;
} else if (cValue === 'false') {
cValue = false;
} else if (cValue === 'true') {
cValue = true;
} else if (cValue === 'null') {
cValue = null;
} else if (cValue === "''") {
cValue = '';
} else if (cValue === '[]') {
cValue = [];
} else if (cValue === '{}') {
cValue = {};
} else if (cValue === 'noopFunc') {
cValue = cloakFunc(function () { });
} else if (cValue === 'trueFunc') {
cValue = cloakFunc(function () { return true; });
} else if (cValue === 'falseFunc') {
cValue = cloakFunc(function () { return false; });
} else if (/^\d+$/.test(cValue)) {
cValue = parseFloat(cValue);
if (isNaN(cValue)) { return; }
if (Math.abs(cValue) > 0x7FFF) { return; }
} else {
return;
}
let aborted = false;
const mustAbort = function (v) {
if (aborted) { return true; }
aborted =
(v !== undefined && v !== null) &&
(cValue !== undefined && cValue !== null) &&
(typeof v !== typeof cValue);
return aborted;
};
// https://github.com/uBlockOrigin/uBlock-issues/issues/156
// Support multiple trappers for the same property.
const trapProp = function (owner, prop, configurable, handler) {
if (handler.init(owner[prop]) === false) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if (odesc instanceof Object) {
owner[prop] = cValue;
if (odesc.get instanceof Function) {
prevGetter = odesc.get;
}
if (odesc.set instanceof Function) {
prevSetter = odesc.set;
}
}
try {
objectDefineProperty(owner, prop, {
configurable,
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
});
} catch (ex) {
}
};
const trapChain = function (owner, chain) {
const pos = chain.indexOf('.');
if (pos === -1) {
trapProp(owner, chain, false, {
v: undefined,
init: function (v) {
if (mustAbort(v)) { return false; }
this.v = v;
return true;
},
getter: function () {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function (a) {
if (mustAbort(a) === false) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
const v = owner[prop];
chain = chain.slice(pos + 1);
if (v instanceof Object || typeof v === 'object' && v !== null) {
trapChain(v, chain);
return;
}
trapProp(owner, prop, true, {
v: undefined,
init: function (v) {
this.v = v;
return true;
},
getter: function () {
return this.v;
},
setter: function (a) {
this.v = a;
if (a instanceof Object) {
trapChain(a, chain);
}
}
});
};
trapChain(window, chain);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setConstant
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
cloakFunc = fn => {
objectDefineProperty(fn, 'name', { value: trappedProp });
const proxy = new Proxy(fn, {
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
},
});
return proxy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
cloakFunc
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
cloakFunc = fn => {
objectDefineProperty(fn, 'name', { value: trappedProp });
const proxy = new Proxy(fn, {
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
},
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
},
});
return proxy;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
cloakFunc
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
defineProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
defineProperty
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
deleteProperty(target, prop) {
if (prop !== 'toString') {
return Reflect.deleteProperty(...arguments);
}
return true;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
deleteProperty
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
get(target, prop) {
if (prop === 'toString') {
return function () {
return `function ${trappedProp}() { [native code] }`;
}.bind(null);
}
return Reflect.get(...arguments);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
mustAbort = function (v) {
if (aborted) { return true; }
aborted =
(v !== undefined && v !== null) &&
(cValue !== undefined && cValue !== null) &&
(typeof v !== typeof cValue);
return aborted;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
mustAbort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
mustAbort = function (v) {
if (aborted) { return true; }
aborted =
(v !== undefined && v !== null) &&
(cValue !== undefined && cValue !== null) &&
(typeof v !== typeof cValue);
return aborted;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
mustAbort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
trapProp = function (owner, prop, configurable, handler) {
if (handler.init(owner[prop]) === false) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if (odesc instanceof Object) {
owner[prop] = cValue;
if (odesc.get instanceof Function) {
prevGetter = odesc.get;
}
if (odesc.set instanceof Function) {
prevSetter = odesc.set;
}
}
try {
objectDefineProperty(owner, prop, {
configurable,
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
});
} catch (ex) {
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapProp
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
trapProp = function (owner, prop, configurable, handler) {
if (handler.init(owner[prop]) === false) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if (odesc instanceof Object) {
owner[prop] = cValue;
if (odesc.get instanceof Function) {
prevGetter = odesc.get;
}
if (odesc.set instanceof Function) {
prevSetter = odesc.set;
}
}
try {
objectDefineProperty(owner, prop, {
configurable,
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
});
} catch (ex) {
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapProp
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
get() {
if (prevGetter !== undefined) {
prevGetter();
}
return handler.getter(); // cValue
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
set(a) {
if (prevSetter !== undefined) {
prevSetter(a);
}
handler.setter(a);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
trapChain = function (owner, chain) {
const pos = chain.indexOf('.');
if (pos === -1) {
trapProp(owner, chain, false, {
v: undefined,
init: function (v) {
if (mustAbort(v)) { return false; }
this.v = v;
return true;
},
getter: function () {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function (a) {
if (mustAbort(a) === false) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
const v = owner[prop];
chain = chain.slice(pos + 1);
if (v instanceof Object || typeof v === 'object' && v !== null) {
trapChain(v, chain);
return;
}
trapProp(owner, prop, true, {
v: undefined,
init: function (v) {
this.v = v;
return true;
},
getter: function () {
return this.v;
},
setter: function (a) {
this.v = a;
if (a instanceof Object) {
trapChain(a, chain);
}
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapChain
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
trapChain = function (owner, chain) {
const pos = chain.indexOf('.');
if (pos === -1) {
trapProp(owner, chain, false, {
v: undefined,
init: function (v) {
if (mustAbort(v)) { return false; }
this.v = v;
return true;
},
getter: function () {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function (a) {
if (mustAbort(a) === false) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
const v = owner[prop];
chain = chain.slice(pos + 1);
if (v instanceof Object || typeof v === 'object' && v !== null) {
trapChain(v, chain);
return;
}
trapProp(owner, prop, true, {
v: undefined,
init: function (v) {
this.v = v;
return true;
},
getter: function () {
return this.v;
},
setter: function (a) {
this.v = a;
if (a instanceof Object) {
trapChain(a, chain);
}
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
trapChain
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function evaldataPrune() {
window.eval = new Proxy(eval, {
apply: (a, b, c) => {
if (c[0] && c[0].includes("commercial") && c[0].startsWith("(") && c[0].endsWith(")")) { let a = c[0].slice(1).slice(0, -1), b = JSON.parse(a); b.entity?.commercial && (b.entity.commercial = void 0), c[0] = `(${JSON.stringify(b)})` }
return Reflect.apply(a, b, c)
}
})
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
evaldataPrune
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function abortCurrentInlineScript(source, property, search) {
const searchRegexp = toRegExp(search);
const rid = randomId();
const SRC_DATA_MARKER = 'data:text/javascript;base64,';
const getCurrentScript = () => {
if ('currentScript' in document) {
return document.currentScript;
}
const scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
};
const ourScript = getCurrentScript();
const abort = () => {
const scriptEl = getCurrentScript();
if (!scriptEl) {
return;
}
let content = scriptEl.textContent;
// We are using Node.prototype.textContent property descriptor
// to get the real script content
// even when document.currentScript.textContent is replaced.
// https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991
try {
const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;
content = textContentGetter.call(scriptEl);
} catch (e) { } // eslint-disable-line no-empty
// https://github.com/AdguardTeam/Scriptlets/issues/130
if (content.length === 0
&& typeof scriptEl.src !== 'undefined'
&& scriptEl.src?.startsWith(SRC_DATA_MARKER)) {
const encodedContent = scriptEl.src.slice(SRC_DATA_MARKER.length);
content = window.atob(encodedContent);
}
if (scriptEl instanceof HTMLScriptElement
&& content.length > 0
&& scriptEl !== ourScript
&& searchRegexp.test(content)) {
hit(source);
throw new ReferenceError(rid);
}
};
const setChainPropAccess = (owner, property) => {
const chainInfo = getPropertyInChain(owner, property);
let { base } = chainInfo;
const { prop, chain } = chainInfo;
// The scriptlet might be executed before the chain property has been created
// (for instance, document.body before the HTML body was loaded).
// In this case we're checking whether the base element exists or not
// and if not, we simply exit without overriding anything.
// e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092
if (base instanceof Object === false && base === null) {
const props = property.split('.');
const propIndex = props.indexOf(prop);
const baseName = props[propIndex - 1];
const message = `The scriptlet had been executed before the ${baseName} was loaded.`;
logMessage(source, message);
return;
}
if (chain) {
const setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
};
Object.defineProperty(owner, prop, {
get: () => base,
set: setter,
});
return;
}
let currentValue = base[prop];
let origDescriptor = Object.getOwnPropertyDescriptor(base, prop);
if (origDescriptor instanceof Object === false
|| origDescriptor.get instanceof Function === false) {
currentValue = base[prop];
origDescriptor = undefined;
}
const descriptorWrapper = Object.assign(getDescriptorAddon(), {
currentValue,
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
},
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
},
});
setPropertyAccess(base, prop, {
// Call wrapped getter and setter to keep isAbortingSuspended & isolateCallback values
get() {
return descriptorWrapper.get.call(descriptorWrapper);
},
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
},
});
};
setChainPropAccess(window, property);
window.onerror = createOnErrorHandler(rid).bind();
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
abortCurrentInlineScript
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
getCurrentScript = () => {
if ('currentScript' in document) {
return document.currentScript;
}
const scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
getCurrentScript
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
getCurrentScript = () => {
if ('currentScript' in document) {
return document.currentScript;
}
const scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
getCurrentScript
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
abort = () => {
const scriptEl = getCurrentScript();
if (!scriptEl) {
return;
}
let content = scriptEl.textContent;
// We are using Node.prototype.textContent property descriptor
// to get the real script content
// even when document.currentScript.textContent is replaced.
// https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991
try {
const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;
content = textContentGetter.call(scriptEl);
} catch (e) { } // eslint-disable-line no-empty
// https://github.com/AdguardTeam/Scriptlets/issues/130
if (content.length === 0
&& typeof scriptEl.src !== 'undefined'
&& scriptEl.src?.startsWith(SRC_DATA_MARKER)) {
const encodedContent = scriptEl.src.slice(SRC_DATA_MARKER.length);
content = window.atob(encodedContent);
}
if (scriptEl instanceof HTMLScriptElement
&& content.length > 0
&& scriptEl !== ourScript
&& searchRegexp.test(content)) {
hit(source);
throw new ReferenceError(rid);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
abort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
abort = () => {
const scriptEl = getCurrentScript();
if (!scriptEl) {
return;
}
let content = scriptEl.textContent;
// We are using Node.prototype.textContent property descriptor
// to get the real script content
// even when document.currentScript.textContent is replaced.
// https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-593638991
try {
const textContentGetter = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent').get;
content = textContentGetter.call(scriptEl);
} catch (e) { } // eslint-disable-line no-empty
// https://github.com/AdguardTeam/Scriptlets/issues/130
if (content.length === 0
&& typeof scriptEl.src !== 'undefined'
&& scriptEl.src?.startsWith(SRC_DATA_MARKER)) {
const encodedContent = scriptEl.src.slice(SRC_DATA_MARKER.length);
content = window.atob(encodedContent);
}
if (scriptEl instanceof HTMLScriptElement
&& content.length > 0
&& scriptEl !== ourScript
&& searchRegexp.test(content)) {
hit(source);
throw new ReferenceError(rid);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
abort
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
setChainPropAccess = (owner, property) => {
const chainInfo = getPropertyInChain(owner, property);
let { base } = chainInfo;
const { prop, chain } = chainInfo;
// The scriptlet might be executed before the chain property has been created
// (for instance, document.body before the HTML body was loaded).
// In this case we're checking whether the base element exists or not
// and if not, we simply exit without overriding anything.
// e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092
if (base instanceof Object === false && base === null) {
const props = property.split('.');
const propIndex = props.indexOf(prop);
const baseName = props[propIndex - 1];
const message = `The scriptlet had been executed before the ${baseName} was loaded.`;
logMessage(source, message);
return;
}
if (chain) {
const setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
};
Object.defineProperty(owner, prop, {
get: () => base,
set: setter,
});
return;
}
let currentValue = base[prop];
let origDescriptor = Object.getOwnPropertyDescriptor(base, prop);
if (origDescriptor instanceof Object === false
|| origDescriptor.get instanceof Function === false) {
currentValue = base[prop];
origDescriptor = undefined;
}
const descriptorWrapper = Object.assign(getDescriptorAddon(), {
currentValue,
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
},
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
},
});
setPropertyAccess(base, prop, {
// Call wrapped getter and setter to keep isAbortingSuspended & isolateCallback values
get() {
return descriptorWrapper.get.call(descriptorWrapper);
},
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
},
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setChainPropAccess
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
setChainPropAccess = (owner, property) => {
const chainInfo = getPropertyInChain(owner, property);
let { base } = chainInfo;
const { prop, chain } = chainInfo;
// The scriptlet might be executed before the chain property has been created
// (for instance, document.body before the HTML body was loaded).
// In this case we're checking whether the base element exists or not
// and if not, we simply exit without overriding anything.
// e.g. https://github.com/AdguardTeam/Scriptlets/issues/57#issuecomment-575841092
if (base instanceof Object === false && base === null) {
const props = property.split('.');
const propIndex = props.indexOf(prop);
const baseName = props[propIndex - 1];
const message = `The scriptlet had been executed before the ${baseName} was loaded.`;
logMessage(source, message);
return;
}
if (chain) {
const setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
};
Object.defineProperty(owner, prop, {
get: () => base,
set: setter,
});
return;
}
let currentValue = base[prop];
let origDescriptor = Object.getOwnPropertyDescriptor(base, prop);
if (origDescriptor instanceof Object === false
|| origDescriptor.get instanceof Function === false) {
currentValue = base[prop];
origDescriptor = undefined;
}
const descriptorWrapper = Object.assign(getDescriptorAddon(), {
currentValue,
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
},
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
},
});
setPropertyAccess(base, prop, {
// Call wrapped getter and setter to keep isAbortingSuspended & isolateCallback values
get() {
return descriptorWrapper.get.call(descriptorWrapper);
},
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
},
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setChainPropAccess
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setter
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
setter = (a) => {
base = a;
if (a instanceof Object) {
setChainPropAccess(a, chain);
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
setter
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
get() {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
return origDescriptor.get.call(base);
}
return this.currentValue;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
set(newValue) {
if (!this.isAbortingSuspended) {
this.isolateCallback(abort);
}
if (origDescriptor instanceof Object) {
origDescriptor.set.call(base, newValue);
} else {
this.currentValue = newValue;
}
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
get() {
return descriptorWrapper.get.call(descriptorWrapper);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
get
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
set(newValue) {
descriptorWrapper.set.call(descriptorWrapper, newValue);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
set
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function addEventListener_defuser() {
let needle1 = '{{1}}';
if (needle1 === '' || needle1 === '{{1}}') {
needle1 = '.?';
} else if (/^\/.+\/$/.test(needle1)) {
needle1 = needle1.slice(1, -1);
} else {
needle1 = needle1.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
needle1 = new RegExp(needle1);
let needle2 = '{{2}}';
if (needle2 === '' || needle2 === '{{2}}') {
needle2 = '.?';
} else if (/^\/.+\/$/.test(needle2)) {
needle2 = needle2.slice(1, -1);
} else {
needle2 = needle2.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
needle2 = new RegExp(needle2);
self.EventTarget.prototype.addEventListener = new Proxy(
self.EventTarget.prototype.addEventListener,
{
apply: function (target, thisArg, args) {
let type, handler;
try {
type = String(args[0]);
handler = String(args[1]);
} catch (ex) {
}
if (
needle1.test(type) === false ||
needle2.test(handler) === false
) {
return target.apply(thisArg, args);
}
}
}
);
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
addEventListener_defuser
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function noWindowOpenIf(
pattern = '',
delay = '',
decoy = ''
) {
const safe = safeSelf();
const targetMatchResult = pattern.startsWith('!') === false;
if (targetMatchResult === false) {
pattern = pattern.slice(1);
}
const rePattern = safe.patternToRegex(pattern);
let autoRemoveAfter = parseInt(delay);
if (isNaN(autoRemoveAfter)) {
autoRemoveAfter = -1;
}
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
const logLevel = shouldLog(extraArgs);
const createDecoy = function (tag, urlProp, url) {
const decoyElem = document.createElement(tag);
decoyElem[urlProp] = url;
decoyElem.style.setProperty('height', '1px', 'important');
decoyElem.style.setProperty('position', 'fixed', 'important');
decoyElem.style.setProperty('top', '-1px', 'important');
decoyElem.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoyElem);
setTimeout(() => { decoyElem.remove(); }, autoRemoveAfter * 1000);
return decoyElem;
};
window.open = new Proxy(window.open, {
apply: function (target, thisArg, args) {
const haystack = args.join(' ');
if (logLevel) {
safe.uboLog('window.open:', haystack);
}
if (rePattern.test(haystack) !== targetMatchResult) {
return Reflect.apply(target, thisArg, args);
}
if (autoRemoveAfter < 0) { return null; }
const decoyElem = decoy === 'obj'
? createDecoy('object', 'data', ...args)
: createDecoy('iframe', 'src', ...args);
let popup = decoyElem.contentWindow;
if (typeof popup === 'object' && popup !== null) {
Object.defineProperty(popup, 'closed', { value: false });
} else {
const noopFunc = (function () { }).bind(self);
popup = new Proxy(self, {
get: function (target, prop) {
if (prop === 'closed') { return false; }
const r = Reflect.get(...arguments);
if (typeof r === 'function') { return noopFunc; }
return target[prop];
},
set: function () {
return Reflect.set(...arguments);
},
});
}
if (logLevel) {
popup = new Proxy(popup, {
get: function (target, prop) {
safe.uboLog('window.open / get', prop, '===', target[prop]);
return Reflect.get(...arguments);
},
set: function (target, prop, value) {
safe.uboLog('window.open / set', prop, '=', value);
return Reflect.set(...arguments);
},
});
}
return popup;
}
});
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
noWindowOpenIf
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoyElem = document.createElement(tag);
decoyElem[urlProp] = url;
decoyElem.style.setProperty('height', '1px', 'important');
decoyElem.style.setProperty('position', 'fixed', 'important');
decoyElem.style.setProperty('top', '-1px', 'important');
decoyElem.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoyElem);
setTimeout(() => { decoyElem.remove(); }, autoRemoveAfter * 1000);
return decoyElem;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
createDecoy = function (tag, urlProp, url) {
const decoyElem = document.createElement(tag);
decoyElem[urlProp] = url;
decoyElem.style.setProperty('height', '1px', 'important');
decoyElem.style.setProperty('position', 'fixed', 'important');
decoyElem.style.setProperty('top', '-1px', 'important');
decoyElem.style.setProperty('width', '1px', 'important');
document.body.appendChild(decoyElem);
setTimeout(() => { decoyElem.remove(); }, autoRemoveAfter * 1000);
return decoyElem;
}
|
---------------------------
Author: limbopro
View: https://limbopro.com/archives/12904.html
---------------------------
|
createDecoy
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/Adblock4limboaass.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/Adblock4limboaass.js
|
MIT
|
function isInIFrame(w) {
w = w || topWindow;
return w !== w.top;
}
|
Loads a shader.
@param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
@param {string} shaderSource The shader source.
@param {number} shaderType The type of shader.
@param {module:webgl-utils.ErrorCallback} opt_errorCallback callback for errors.
@return {WebGLShader} The created shader.
|
isInIFrame
|
javascript
|
limbopro/Adblock4limbo
|
Adguard/twdl.webgl.user.js
|
https://github.com/limbopro/Adblock4limbo/blob/master/Adguard/twdl.webgl.user.js
|
MIT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.