Persistent Breakpoints in Safari

How to get Safari debugger to save breakpoint when refreshing page? I am trying to debug the code executed by onLoad, so I do not have time to set a breakpoint before the code is executed, and when I refresh the page after setting a breakpoint, the breakpoint will be lost.

(This code is in Dojo widgets, so it is loaded via XHR, if that matters.)

+4
source share
1 answer

There is a javascript description that you might debugger useful with debugger . Although this feature is poorly documented, it usually launches your browser’s built-in debugger. The only comment I really found in the statement is this .

Javascript as a language specification does not have a debug operator, however, all implementations implement a debugger instruction.

Although, I'm not sure why your breakpoints are not saved. I don't have Safari for testing, but Chrome (which is also based on Webkit) seems to save breakpoints correctly.

EDIT

I managed to find the documentation for the debugger statement , but this is not very descriptive:

Invokes any debugging functionality available. If debugging features are not available, this statement has no effect.

+2
source

Source: https://habr.com/ru/post/1342853/


All Articles