Skip to content

Instantly share code, notes, and snippets.

@abhinavm24
Forked from Trion129/timekiller.js
Created August 5, 2020 10:08
Show Gist options
  • Save abhinavm24/bb3b3c58bea8cf4b3a561990b11d982a to your computer and use it in GitHub Desktop.
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
// 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