Languages
[Edit]
EN

Google Chrome - stop infinite loop in JavaScript debug

17 points
Created by:
Marcin
15740

Using Google Chrome, there are few ways to stop JavaScript debugging.

1. Stop button in Chrome DevTools example

Note: to use this approach DevTools should be turned on before JavaScript code will be executed. In other case we will be not able to open the tools with F12 because of Chrome window gets freezes. It will be still possible to turn on the tools with browser menu but tools will not get connection with executed source code to stop it - in this case code executing can be stopped only via closing tab or window. Sometimes for small amount of RAM or big amount of opened tabs DevTools can have problem to stop infinity script.

Steps:

  1. open Chrome DevTools with F12, Ctrl+Shift+i or from menu Main menuMore toolsDeveloper tools,
  2. open web page that you want to debug,
  3. make action that contains infinity loop,
  4. make active focus on Chrome DevTools window,
  5. pause script with F8, Ctrl+\ or by clicking Pause script execution button,
  6. press mouse button for 1-3 seconds on the button again to see more options,
  7. move click action to square stop button on expanded menu to stop permanently script execution.
Explanation, how to open Google Chrome DevTools from menu.
Explanation, how to open Google Chrome DevTools from menu.

 

Explanation, how to pause infinity JavaScript loop using Google Chrome DevTools.
Explanation, how to pause infinity JavaScript loop using Google Chrome DevTools.

 

Explanation, how to stop JavaScript loop using Google Chrome DevTools.
Explanation, how to stop JavaScript loop using Google Chrome DevTools.

2. End process by closing tab or window example

Use close button to stop process. If it does not help use Task manager described in next approach of this post.

3. End process button in Task manager example 

Steps:

  1. open Chrome Task manager with Shift+Esc or from menu Main menuMore toolsTask manager,
  2. find process on list by tab name or biggest cpu load (use column sort option),
  3. select process and click End process button.
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join