We can list event listeners in devtools, but not Observers

NEW
Unassigned

Status

()

Firefox
Developer Tools
P3
enhancement
10 months ago
2 months ago

People

(Reporter: pbro, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 months ago
IntersectionObserver is being enabled by default in bug 1321865, it's a great API that lets web pages observe changes in the intersection elements.

There is no way, however, to know if an observer is currently running or not, or even find if there are observers at all that have been created on the page.

This isn't the only Observer type that exists. The MutationObserver is very similar to it, except that it does not observe the same things.

I tend to this these observers are very similar to event listeners. And, today, devtools lets you know about event listeners, but not about observers.

In the (old) debugger front-end (the one that shows up when devtools.debugger.new-debugger-frontend is false), there is an event side panel that lists all event listeners. I think if we were to make something for Observers, it would need to be similar to that. A list of observers, with their current states, maybe a checkbox to toggle their states, and clicking on them would take you to where they are defined in the source code.
Would it be more or less discoverable if it were something similar to the event listener tooltip in the markup view?  Both observers can have specific root nodes, so maybe they could be listed in the existing event listener tooltip, or as an extra bubble with different UI in the markup next to their respective root node.

I tend to forget about the event list we had in old debugger frontend, so that's why I mentioned this.
Priority: -- → P3
(Reporter)

Updated

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