Set breakpoints in the debugger directly from the inspector
Categories
(DevTools :: Inspector, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: karlcow, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(1 file)
303.43 KB,
image/png
|
Details |
Comment 1•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 2•3 years ago
|
||
The Inspector popup window is rendering list of event listeners collected using platform API nsIEventListenerService
and nsIEventListenerInfo
- https://searchfox.org/mozilla-central/rev/42ae3bea104c37a9986c6f18d17bd9ddb387129c/dom/events/nsIEventListenerService.idl#63
- https://searchfox.org/mozilla-central/rev/42ae3bea104c37a9986c6f18d17bd9ddb387129c/dom/events/nsIEventListenerService.idl#36
Steve, could we usensIEventListenerInfo.listenerObject
to set a breakpoint? (e.g. on the first instruction within the listener function?)
If not, is there another way how to break JS execution when the listener is executed?
This would help us to implement this feature.
Honza
Comment 3•3 years ago
|
||
I'm not sure who can answer a question like this, but tcampbell comes to mind as the most likely one to know how to get to a script from an object. Whatever an "underlying JS object of the event listener" is, exactly.
Reporter | ||
Comment 4•3 years ago
|
||
https://twitter.com/razvancaliman/status/1414173873889763328
That's probably another way to do it.
Safari on the break on event list gives the possibility to add conditions, which will execute the break only when a certain condition is met. Very similar to what we do in the debugger when we set a breakpoint on a line.
Comment 5•3 years ago
|
||
Yes, I believe you should be able to. Get the Debugger.Object
for listenerObject
and then access script. Then a breakpoint can be set at offset 0 for the entry point. I'm not sure off the top of my head what the equivalent devtool actors are for these concepts, but this should not be that different than normal debugger features.
Updated•3 years ago
|
Updated•2 years ago
|
Description
•