Maleev
Maleev

Reputation: 863

Stop on breakpoints while evaluating expression typed in Chrome dev console?

Is it possible to evaluate an expression that is typed in Chrome console that will stop on breakpoints through the execution path of that expression? Specifically, I would like to do this while debugger is NOT stopped - so that I can initiate it while debugging my code without having to wait for some browser event to happen. Any thoughts?

Upvotes: 1

Views: 1742

Answers (1)

Maleev
Maleev

Reputation: 863

Turns out that is actually console's standard behavior - did not work for me because I was executing the expression in the top frame context instead of iframe context.

Although both the main window and iframe had the same js file loaded - they were apparently two different copies, thus setting breakpoint in one would not set a breakpoint in the other. Not to say that even if breakpoints were mirrored I would be likely misled to think that the state of variables I'm inspecting is one from the iframe and not top window... Solution: use drop-down at the top of console next to filter icon to pick the appropriate context.

Upvotes: 1

Related Questions