Today I Learned

How to find code making the browser freeze

When for some reason the application causes the browser to freeze, it is problematic to find the root cause because the devtools also stop responding.

Here’s one way to quickly find the issue.

  • Open the devtools on Sources tab
  • Enter the page that causes the browser to freeze
  • Quickly click “Pause script execution”

Likely the application will be stopped during execution of the problematic script. Now by using of stepping and checking callstack you can find the problematic piece of code.