Search code examples
javascriptdebugginggoogle-chrome-devtoolsweb-inspectorjavascript-debugger

Chrome devtools: Drop into debugger without switching to Sources tab


If I put the debugger statement in my JavaScript source with the Chrome devtools open, it'll stop execution so I can interactively explore the current context from the console. It's really awesome.

But unfortunately it will also switch to the Sources tab and display the line where the debugger statement happened. Most of the time, I want to type JavaScript commands, so I have to manually switch back to the Console tab.

Can I avoid the tab-switching and stay in the Console tab?

Or am I using it wrong?


Solution

  • Looks like Chrome added a preference for this in the intervening 9 years: https://stackoverflow.com/a/69216922/66673

    Quoting that answer:

    I had the same issue and it was driving me nuts! The way I managed it to stop switching was to go to into the DevTools settings -> Preferences.

    Under Sources options, uncheck Focus Sources panel when triggering a breakpoint.