Open Bug 1460106 Opened 6 years ago Updated 2 years ago

Set breakpoints in the debugger directly from the inspector

Categories

(DevTools :: Inspector, enhancement, P3)

61 Branch
enhancement

Tracking

(Not tracked)

People

(Reporter: karlcow, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

The inspector in the devtools with its event flags is cool. Very cool. The link to the code (when it's working) is really nice too. What I would like is to be able to set a breakpoint directly on this event right away from the inspector view for this specific element. There should be an icon to click that would set the breakpoint for this element and only this one. So at the next interaction with this element, it triggers the breakpoint and open the debugger at the right place on the prettified version of the code.
We got some plans to bring back a combination of the old events breakpoints and Chrome's event type breakpoints that would be easy to drive from the Inspector. This part would be considered!
Severity: normal → enhancement
Priority: -- → P3
Product: Firefox → DevTools

The Inspector popup window is rendering list of event listeners collected using platform API nsIEventListenerService and nsIEventListenerInfo

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

Flags: needinfo?(sphink)

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.

Flags: needinfo?(sphink) → needinfo?(tcampbell)

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.

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.

Flags: needinfo?(tcampbell)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: