Mike Ratcliffe suggested this:
> let eventListenerService =
> let elt = content.document.getElementById(aNode.id);
> eventListenerService .getListenerInfoFor(elt).getDebugObject();
> I am fairly certain that this gives access to some useful event info
> ... the only problem is that the debugger needs to be running in
> order to use it.
The debugger doesn't need to be running if you only need to list the listeners attached to an element. You can use the following code for that:
let eventListenerService =
let elt = content.document.getElementById(aNode.id);
let result = eventListenerService.getListenerInfoFor(elt);
If you want to do more than simply listing them then the debugger needs to be running.
See also following Firebug extension that uses nsIEventListenerService to display event handlers.
still want something like this.
Created attachment 771594 [details]
Opera 12.16 handle this in an elegant way (highlighted in yellow).
On mouse over you can see all events types / handlers.
the firebug implementation lives in the following places.
we could rip it out and put it into the web console, then use it to spice up the inspector
(In reply to flying sheep from comment #6)
> the firebug implementation lives in the following places.
> we could rip it out and put it into the web console, then use it to spice up
> the inspector
Thanks. elService being:
> let eventListenerService = Cc["@mozilla.org/eventlistenerservice;1"]
Or we could reuse the code in the debugger (maybe even move it to devtools/shared/).
(In reply to Panos Astithas [:past] from comment #8)
> Or we could reuse the code in the debugger
which lives where? (i’d like to create an extension like eventbug for the web console, so i’d like to see all prior art here for inspiration ☺)
The backend part which could be refactored to call a shared implementation is here:
The main frontend part is here:
We've had event information in the inspector for a while now, I think since bug 1044932.
*** This bug has been marked as a duplicate of bug 1044932 ***