How do you force Chrome pages/tabs to crash using

2019-01-21 07:20发布

问题:

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?

回答1:

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...


Extra

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!

Oh yeah...

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.



回答2:

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


回答3:

Simple enter the following line of code into the chrome address bar to see a Chrome tab crash simulation:

chrome://crash