As said in the title, I am looking for the best way to freeze a computer. I have done a bit of research, but was not able to find anything on this subject (probably because I'm using Yahoo).
I have made a program and it would be preferrable if the code was hidden and have a detect-inspect-element function from this question. Currently, my freeze function is just while(true){}
, but I am looking for something way slower. I am on a chromebook and a while
loop will only lag the current page.
I have seen people use history.pushState()
to lag other pages and even make it hard to x out, but I was not able to replicate the inefficiency. Any help would be useful.
You can't freeze a browser with JavaScript, by-design: the browser's JS engine will detect high CPU usage and abort, kill, interrupt, or suspend the offending JavaScript.
In ye olden days (pre IE6) when browser's JavaScript engines were tied-in with their window-message pumps, it was possible for a script to block all user interaction with a browser (and we see the legacy of that today with how alert()
and prompt()
will block many browser/user interactions when their message windows are open) - but because of widespread troll/joke webpage scripts in the very early 2000s which would spam popups and move windows around on the desktop and worse, browsers severely curtailed JavaScript's ability to interfere with user-interaction.
As said in my question, I have seen people spam history.pushState() to lag other pages and even make it hard to x out.
@thebadquestionaccount Yes, those techniques may work right now in some browsers, but ultimately those are security-related (denial-of-service) bugs in browsers that browser vendors have decided to make a priority to fix - so if you are able to lag or crash a browser today then I'd be willing to be $50 that the next major browser release will address that issue and your script won't work anymore.
May I have an example?