If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

No built-in way to retrieve information about what events a DOM node listens to




DOM: Events
9 years ago
9 years ago


(Reporter: maikmerten, Unassigned)


Firefox Tracking Flags

(Not tracked)




9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9) Gecko/2008061015 Firefox/3.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9) Gecko/2008061015 Firefox/3.0

Problem: It's apparently not easily possible to find out what events DOM nodes are listening for.

Use cases one:

I'm developing an extension (based on the popular Testgen4Web extension, http://developer.spikesource.com/wiki/index.php/Projects:TestGen4Web ) which records user interaction with web-applications and offers replay functionality. This is classic Record & Replay testing.

Recording "low-rate" events (onchange, onclick, onsubmit) simply involves recording what the event target was and fetching any involved data (e.g. text inputs).

"High-rate" events like basically all mouse events (e.g. mouseover) mostly don't express real interaction with a web-application (it's mostly user-input noise) and shouldn't be recorded if there isn't actually a listening element involved.

A way to query which events a DOM node listens for would make it possible to record only "relevant" events, thus preventing "recording bloat", which in worst case could make test cases intransparent for humans.

Use case two:

Many web-applications register events on DOM elements during "initialization". Those events are usually important for user interaction. However, it's not possible to easily check if listeners were registered properly for a given element, which may be a problem for debugging.

Implementing a way to query what events an element listens for would make it really easy to write an extension which e.g. upon a simple click reveals what events are registered, giving direct feedback to the developer.

Both usecases describe how the requested feature may improve development of web-applications by enabling the creation of tools for better testing (usecase one) and diagnostics (usecase two).

Reproducible: Always

Actual Results:  
Actual Results: Doesn't apply
You need to log in before you can comment on or make changes to this bug.