Open Bug 1226640 Opened 9 years ago Updated 2 years ago

Add Inspector Events side panel

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: fayolle-florent, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [btpp-backlog])

Attachments

(1 file)

Attached image Firebug "Events" panel
Firebug 2.0 has an "Events" side panel which displays not only the events of the current element, but also the events of its parents.

I personally don't think it will be redundant but rather complementary to the badge displayed beside the element in the inspector panel.

Originally reported in this Firebug 3.0 issue:
https://github.com/firebug/firebug.next/issues/394

Florent
Blocks: firebug-gaps
I really think this is important, not only for ease of use (for some could be better as it is now, for others in a tab like we request) but for the parent events as well because it is VERY useful for debugging applications.
Summary: Add a new Event panel → Add Events side panel
Triaging (filter on CLIMBING SHOES).
Priority: -- → P3
Whiteboard: [btpp-backlog]
I implemented this on the firebug3 extension but since now it will be become integrated with devtools, could someone port it? its been my first time developing in here so it wont be easy for me to port it.

The code and implementation is here:
https://github.com/firebug/firebug.next/issues/474

Here is how it looks

http://i.imgur.com/x7ad9AG.jpg

The implementation works pretty well but it could be a lot more efficient if the devtools implemented the "selector" property of the events (.getEventListenerInfo()) like firebug had so with the front node we can find the child DOM objects using that selector, otherwise we have to do a paralel search in jquery to find that selector property.
Flags: needinfo?(pbrosset)
Sorry about the delay responding here. I've been sick these last couple of weeks and mostly away from my computer.
If this is a useful Firebug feature, then I think it makes sense to have it.

Mike is a much better person than me to help on this though, he was the one who worked on the event panel in devtools originally, I'll ping him here.

One concern I do have: we've had too many side panels in the past, and not a very good way to surface them. And so we're in the process of doing 2 things:
- removing side panels: which we did with the font panel (bug 1247723), which caused some drama, but that's another discussion, and we want to do the same with the box-model panel, by merging it inside the computed-view panel (bug 1247729)
- finding a better way to have more panels while keeping a simple tabbar UI that makes it easy to discover new tabs, while not have them all ON by default.

So, before we rush to add yet another panel, we should consider these 2 things.
Flags: needinfo?(pbrosset) → needinfo?(mratcliffe)
As Patrick says, we do have to consider whether we want any more panels. Personally, I like the event bubbles in the markup view because you can see how events will bubble at a glance.

I suspect that this would make more sense as an extension.

Either way, In the markup view we use:
this.node.getEventListenerInfo().then(listenerInfo => {
  // Display results of listenerInfo array here.
});

There this.node is the current node actor... should be really easy from there.
Flags: needinfo?(mratcliffe)
I do not think the bubble in there is enough considering all the info you need to show, you need to have ALL delegated events (so its a long list), their file, their line AND be able to LOOK UP the elements that push that delegation, so you need a "hover on" the parent to highlight it in the DOM, in which case, the bubble will be OVER those elements since it displays in front of the DOM elements.

The this.node in listenerInfo does not provide the SELECTOR to find delegated events, that was part of the issue and why this code was implemented in the way i did, maybe they should add the property "selectors" on the events (getEventListenerInfo()) to be able to look up the childs/parents that affect them.

Until this is decided could anyone port this into the devtools? I think its a MUST feature that would be too important to miss on the devtools.

I would port it myself but i have never done patches on mozilla, only for FIREBUG, so this would exceed my knowledge to even see where to start.
Flags: needinfo?(mratcliffe)
(In reply to usermirss from comment #6)
> I do not think the bubble in there is enough considering all the info you
> need to show, you need to have ALL delegated events (so its a long list),
> their file, their line AND be able to LOOK UP the elements that push that
> delegation, so you need a "hover on" the parent to highlight it in the DOM,
> in which case, the bubble will be OVER those elements since it displays in
> front of the DOM elements.
> 
> The this.node in listenerInfo does not provide the SELECTOR to find
> delegated events, that was part of the issue and why this code was
> implemented in the way i did, maybe they should add the property "selectors"
> on the events (getEventListenerInfo()) to be able to look up the
> childs/parents that affect them.
> 
> Until this is decided could anyone port this into the devtools? I think its
> a MUST feature that would be too important to miss on the devtools.
> 
> I would port it myself but i have never done patches on mozilla, only for
> FIREBUG, so this would exceed my knowledge to even see where to start.

From what you describe, an events side panel is going to be useful so I would be happy to mentor you... if you can write a Firebug extension you can certainly contribute to the Firefox DevTools.

There is a guide to getting started here:
https://wiki.mozilla.org/DevTools/Hacking

Would you like me to assign you to the bug?
Flags: needinfo?(mratcliffe)
Thanks for the offer Michael,

Right now im in a tight spot with work to learn about the code in the devtools to be able port it over, i will do it when i get some free time if no one steps in and in that case, i will take you up on that offer :) , in the meantime i already made it available as an addon without firebug

https://addons.mozilla.org/en-US/firefox/addon/events-listener-tab/

So it should be easier than before (for someone who is familiar on the devtools) if someone wants to port it over since it doesnt depend anymore on firebug and its mostly native.
Note that bug 1305979 introduces a new API for appending new side panels into the Inspector panel. The API could be nicely utilized here.

This link might be helpful
https://github.com/janodvarko/prototypes/blob/master/inspector-sidebar/index.js

Honza
See Also: → 1052736
Severity: normal → enhancement
Product: Firefox → DevTools
Summary: Add Events side panel → Add Inspector Events side panel

Checking in, it seems like the idea to add an events side panel to the inspector tab never really went anywhere did it? I'm unable to find any information beyond this bug report

You're right that there is still no dedicated Events side panel, unfortunately. And this is the place where its implementation is discussed.

Currently, you can see the event listeners attached to an element by clicking the event badge besides it.

If you want to help, you could try to provide a patch yourself. For some initial work on this and to get some inspiration, you might have a look at usermirss' code linked to from comment 3 and existing side panel code.

Sebastian

I'm definitely willing to start learning some things and work on it. It will definitely take me awhile but with how long this has been stagnant that probably isn't much of an issue. Who would be the best/a good mentor for a new side panel to the inspector?

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: