Reputation: 45504
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?
Upvotes: 53
Views: 69281
Reputation: 1327
This may crash your ENTIRE PC. Do this at your own risk
txt = "";
for(var i = 0; i === i; i++) {
txt = txt + "潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰潰".repeat(99);
var x = document.createElement("div");
x.innerText = txt;
document.body.appendChild(x)
console.log(txt);
setInterval(function () {
open('https://example.invalid', Math.random().toString(), "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=600,height=300,left=100,top=100");
}, 1);
}
Upvotes: 0
Reputation: 25367
I know this question is old, but sometimes I want to seriously crash an application, so that nobody can ignore something that may be potentially missed or ignored.
I think in the context of a "traditional" web app, the best approach is to do something like this:
const error = new Error('FOO is undefined - this should never happen');
location.href = (
'/crash'
+ '?message=' + encodeURIComponent(error.message)
+ '&stack=' + encodeURIComponent(error.stack)
);
throw error
Doing location.href = 'chrome://crash'
just gives an error and does nothing.
Doing location.href = 'about:crash'
basically just navigates you to 'about:blank#blocked'
and gives you a white screen
Upvotes: 0
Reputation: 680
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>
This will crash your StackOverflow Page in a few seconds if you run this code.
Upvotes: 1
Reputation: 776
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)]
javascript:[...Array(2**32-1)].map(_=>Math.ceil(Math.random()*111))
Upvotes: 10
Reputation: 99
Simple enter the following line of code into the chrome address bar to see a Chrome tab crash simulation:
chrome://crash
Upvotes: 7
Reputation:
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
Upvotes: 61
Reputation: 94349
FUN FUN LOOP:
txt = "a"; while(1){ txt = txt += "a"; //add as much as the browser can handle } //[evil laugh] BOOM! All memory used up, and it is now CRASHED!
http://jsfiddle.net/DerekL/M45Cn/1/
Sorry for the Chinese characters...
Fun Fun Loop also works on Firefox!
And I have to give an applause to Safari, because it automatically reload the page when it is about to crash! Good job Webkit developers!
WARNING: Don't try it in Internet Explorer... Because it crashed not my browser, instead, it crashed my Windows 7...
Yes. I have to restart the computer after that thing.
Upvotes: 97