'How do you force Chrome pages/tabs to crash using JavaScript?
Trying to set window.location or using window.navigate() to make the browser go to about:crash or chrome://crash doesn't work. Is there a way to do it?
Solution 1:[1]
I realize this question is over a year old, but apparently you can use chrome://inducebrowsercrashforrealz.
Here is a list of additional debug chrome:// URLs, taken from chrome://about:
chrome://crash
chrome://kill
chrome://hang
chrome://shorthang
chrome://gpuclean
chrome://gpucrash
chrome://gpuhang
chrome://ppapiflashcrash
chrome://ppapiflashhang
chrome://restart
Solution 2:[2]
Simple enter the following line of code into the chrome address bar to see a Chrome tab crash simulation:
chrome://crash
Solution 3:[3]
This is by far the most simple way. Create an Array with the largest number possible for Arrays. This will not take up a computer's memory, but it will crash the page in a number of seconds.
[...Array(2**32-1)]
Let's say that your computer can handle this (it shouldn't). Try this to give your computer more stress:
[...Array(2**32-1)].map(_=>Math.ceil(Math.random()*111))
These can be called from the address bar with:
javascript:[...Array(2**32-1)]
or
javascript:[...Array(2**32-1)].map(_=>Math.ceil(Math.random()*111))
Solution 4:[4]
Found this on Reddit
Crashes an i5 8th Gen in a few seconds.
for (var i = 5; i > 3; i = i + 1)
{ console.log(i); }
<html>
<h1>This Should Crash Your Browser</h1>
</html>
Disclaimer
This will crash your StackOverflow Page in a few seconds if you run this code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Bob |
| Solution 3 | Community |
| Solution 4 | Muneeb Ahmad Khurram |
