by masklinn · 9y ago · 0 comments
That's one of the few nice/advanced features from Xcode and Safari, aside from making a breakpoint conditional you can:
* skip it the first n times (default: 0)
* make it non-breaking
* associate various actions which are executed if the breakpoint "triggers" (the condition matches) even if the breakpoint is non-breaking, in Safari these actions are "Log Message" (formatted plain text), "Evaluate" (arbitrary javascript code), "Play Sound" (beep on every tripping of the breakpoint) and "Probe Expression"[0]: https://webkit.org/blog/5435/breakpoint-options/
[0] a special kind of table logging which integrates with the debugger rather than the (separate) console tab
Granted, the UI isn't as clear about the capabilities, but I generally prefer "run JS, return true" over "choose one of N kinds of things to do", even if one of the N is "run JS, return true". Minus skip counters, those are a bit annoying by hand (needing globally unique var names and all).
I'm not sure when Firefox's built-in debugger got it, but I see search results implying they've been part of FireBug since 2007 at the very least. And I don't remember Chrome's debugger ever not having it (once they got their current-gen-like one, iirc it launched with extremely limited devtools?), though I could easily be forgetting the early days.
You can obviously do that in any browser, it's just inflexible, ugly, error-prone and inconvenient.
So UX/discovery-wise adding these features as advanced extensions of breakpoints is more sensible than breakpoints being a special case of tracepoints.