Created
July 13, 2018 14:49
-
-
Save Trion129/f7562809bb037ad4a9bc68d17943d663 to your computer and use it in GitHub Desktop.
Kills all timers in a website, doesn't kill already killed timeouts for micro optimisation for nerds :P
This file contains hidden or 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
// Break Timers on websites with ease. | |
function timerKiller(){ | |
var lastCleanedBorder = 0; | |
return function () { | |
var id = window.setTimeout(function() {}, 0); | |
for(var i = lastCleanedBorder; i <= id; i++) { | |
window.clearTimeout(i); | |
} | |
lastCleanedBorder = id + 1; | |
console.log(lastCleanedBorder); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: