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
Usage: