fix: script wrapper anti-detection
This commit is contained in:
parent
cc8bddd551
commit
18da36a34a
1 changed files with 8 additions and 2 deletions
|
@ -23,7 +23,13 @@ if (_GM && _GM.registerMenuCommand && _GM.openInTab) {
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
const id = '' + Math.random();
|
const id = '' + Math.random();
|
||||||
w[id] = resolve;
|
w[id] = resolve;
|
||||||
setTimeout(`(function a(){window['${id}'](new Image());delete window['${id}'];})()//# sourceURL=${location.href}`)
|
|
||||||
|
const stackN = 9
|
||||||
|
const loaderIntro = '(function a(){'.repeat(stackN)
|
||||||
|
const loaderOutro = '})()'.repeat(stackN)
|
||||||
|
const mockUrl = "https://c.amazon-adsystem.com/aax2/apstag.js"
|
||||||
|
|
||||||
|
setTimeout(`${loaderIntro}const d=new Image();window['${id}'](d);delete window['${id}'];document.body.prepend(d)${loaderOutro}//# sourceURL=${mockUrl}`)
|
||||||
}).then(d => {
|
}).then(d => {
|
||||||
d.style.display = 'none';
|
d.style.display = 'none';
|
||||||
d.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
d.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
||||||
|
@ -31,4 +37,4 @@ new Promise(resolve => {
|
||||||
d.setAttribute('onload', `if(this.once)return;this.once=true;this.remove();const GM=window['${gmId}'];delete window['${gmId}'];(` + function a () {
|
d.setAttribute('onload', `if(this.once)return;this.once=true;this.remove();const GM=window['${gmId}'];delete window['${gmId}'];(` + function a () {
|
||||||
/** script code here */
|
/** script code here */
|
||||||
|
|
||||||
}.toString() + ')()');document.body.prepend(d)})
|
}.toString() + ')()')})
|
Loading…
Reference in a new issue