-
-
Save abhinavm24/bb3b3c58bea8cf4b3a561990b11d982a 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 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