Open Bug 1861922 Opened 7 months ago Updated 7 months ago

browsingContext.navigate should directly listen to NetworkObserver events

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

In Bug 1852891 we are adding a set of internal events to the network module so that they can be monitored by the browsingContext.navigate command in case of a wait=complete navigation.

This tightly links the network module and the browsingContext module. Instead we should find a way to listen to network events directly from the NetworkObserver layer.

However since the network observer is currently instantiated by the network module, doing this from the browsingContext module as well means instantiating 2 NetworkObservers and then creating twice the network event objects for each an every request, which might have a performance impact.

We should introduce an intermediary class which ensures that we only create a single network observer and share it for all the consumers.

I assume that such a singleton could perfectly be handled by the wanted root BiDi module?

We don't really have a concept of root bidi module at the moment. We want to add a base RootBiDiModule class, but that's just going to be a base class instantiated for all modules.

Here we could work at the message handler level, and have this owned by the RootMessageHandler.

I guess we could also have a real singleton if we want to avoid creating different instances for multiple sessions, but already having it shared in a single session would already be useful.

Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.