Skip to content

Instantly share code, notes, and snippets.

@sekaiwish
Created April 15, 2022 14:29
Show Gist options
  • Save sekaiwish/faaf163d7125d457facc17860ce8c5c0 to your computer and use it in GitHub Desktop.
Save sekaiwish/faaf163d7125d457facc17860ce8c5c0 to your computer and use it in GitHub Desktop.
Prevent DevTools
setInterval(function() {
var responseTime = 100;
var before = new Date().getTime();
debugger;
var after = new Date().getTime();
if (after - before > responseTime) {
document.body.innerHTML = "";
location.reload();
}
}, 50);
// One-liner
// setInterval(function(){var a=100;var b=new Date().getTime();debugger;var c=new Date().getTime();if(c-b>a){document.body.innerHTML="";location.reload();}},50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment