title: How to terminate script execution when debugging in Google Chrome?
body: <p>When stepping through JavaScript code in Google Chrome debugger, how do I terminate script execution if I do not want to continue? The only way I found is closing the browser window.</p>
  
  <p>Pressing "Reload this page" runs the rest of the code and even submits forms as if pressing F8 "Continue".</p>
  
  <p><strong>UPDATE</strong>: </p>
  
  <p>When pressing F5 (Refresh) while a script is paused:</p>
  
  <ul>
  <li>Google Chrome (v22) runs the script. If the script submits HTTP request, the HTTP response for that request is displayed. The original page is not refreshed.</li>
  <li>IE 9 just freezes. However IE has an option "Stop Debugging" which, when pressed (provided you did not press F5 earlier), continues to run the script outside debugger.</li>
  <li>Firebug behaves identically to Chrome.</li>
  </ul>
  
  <p>Closing and then opening again the browser window is not always the next easiest way
  because it will kill browser session state and that may be important. All your breakpoints are also lost.</p>
  
  <p><strong>UPDATE (Jan 2014)</strong>: </p>
  
  <p>Refresh while debugging:</p>
  
  <ul>
  <li>Chrome v31: lets scripts to run and stops on further breakpoints (but does not submit ajax requests), then refreshes.</li>
  <li>IE 11: refresh does nothing, but you can press F5 to continue.</li>
  <li>Firefox v26: lets scripts to run but does not stop on further breakpoints, submits ajax requests, then refreshes.</li>
  </ul>
  
  <p>Kind of progress!</p>
  
  <p>Navigate to the same page while debugging:</p>
  
  <ul>
  <li>Chrome v31: same as Refresh.</li>
  <li>IE 11: scripts are terminated, new browser session is started (same as closing and opening again).</li>
  <li>Firefox v26: nothing happens.</li>
  </ul>
  
  <p>Also <em>juacala</em> suggested an effective workaround. For example, if you are using jQuery, running <strong>delete $</strong> from console will stop execution once any jQuery method is encountered. I have tested it in all above browsers and can confirm it is working.</p>
  
  <p><strong>UPDATE (Mar 2015)</strong>: </p>
  
  <p>Finally, after over 2 years and almost 10K views, the right answer was given by Alexander K. Google Chrome has its own Task Manager which can kill a tab process <em>without</em> closing the tab itself, keeping all the breakpoints and other stuff intact.</p>
  
  <p>I even went as far as BrowserStack.com to test it in Chrome v22 and found that this was working this way even at that time.</p>
  
  <p>Juacala's workaround is still useful when debugging in IE or Firefox.</p>
  
  <p><strong>UPDATE (Jan 2019)</strong>:</p>
  
  <p>Chrome Dev Tools at last added a proper way to stop script execution which is nice (although a bit hidden). Refer to James Gentes's answer for details.</p>