Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kills all timers in a website, doesn't kill already killed timeouts for micro optimisation for nerds :P
// 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);
}
}
@Trion129

This comment has been minimized.

Copy link
Owner Author

commented Jul 13, 2018

Usage:

var state = timerKiller()
state()
state()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.