fix: script wrapper anti-detection

This commit is contained in:
Xmader 2020-12-08 14:36:31 -05:00
parent cc8bddd551
commit 18da36a34a
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
1 changed files with 8 additions and 2 deletions

View File

@ -23,7 +23,13 @@ if (_GM && _GM.registerMenuCommand && _GM.openInTab) {
new Promise(resolve => {
const id = '' + Math.random();
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 => {
d.style.display = 'none';
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 () {
/** script code here */
}.toString() + ')()');document.body.prepend(d)})
}.toString() + ')()')})