-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Step 1: fool twitter into thinking scripts loaded | ||
window.__SCRIPTS_LOADED__ = Object.freeze({ | ||
main: true, | ||
vendor: true, | ||
runtime: false | ||
}); | ||
|
||
// Step 2: continously wreck havoc | ||
let _destroyerInt = setInterval(() => { | ||
delete window.webpackChunk_twitter_responsive_web; | ||
window.__SCRIPTS_LOADED__ = Object.freeze({ | ||
main: true, | ||
vendor: true, | ||
runtime: false | ||
}); | ||
if(document.getElementById('ScriptLoadFailure')) { | ||
document.getElementById('ScriptLoadFailure').remove(); | ||
} | ||
}); | ||
|
||
// Step 3: destroy twitter critical modules | ||
let _originalPush = Array.prototype.push; | ||
Array.prototype.push = function() { | ||
try { | ||
if(arguments[0]?.[0]?.[0] === "vendor" || arguments[0]?.[0]?.[0] === "main") { | ||
throw "Twitter killing magic killed Twitter https://lune.dimden.dev/f016efffcd3d.png (thats fine)"; | ||
} | ||
} catch(e) { | ||
Array.prototype.push = _originalPush; | ||
} finally { | ||
return _originalPush.apply(this, arguments); | ||
} | ||
} | ||
|
||
// Step 4: prevent twitter from reporting it | ||
let _originalTest = RegExp.prototype.test; | ||
RegExp.prototype.test = function() { | ||
try { | ||
if(this.toString() === '/[?&]failedScript=/') { | ||
RegExp.prototype.test = _originalTest; | ||
throw "hehe"; | ||
}; | ||
} catch(e) { | ||
RegExp.prototype.test = _originalTest; | ||
} finally { | ||
return _originalTest.apply(this, arguments); | ||
} | ||
} | ||
|
||
// Step 5: self destruct | ||
setTimeout(() => { | ||
clearInterval(_destroyerInt); | ||
Array.prototype.push = _originalPush; | ||
}, 5000); | ||
|
||
// Step 6: Live OTD reaction: https://lune.dimden.dev/6743b45eb1de.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters