Open Bug 1876240 Opened 8 months ago Updated 8 months ago

Fix browsingContext.getTree with unloaded tabs in WebDriver BiDi

Categories

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

task
Points:
2

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

(Whiteboard: [webdriver:backlog])

As discussed in https://phabricator.services.mozilla.com/D199225#6843354, unloaded tabs are not really well supported in our current BiDi commands and events.

Known issues:

  • session data items for a specific context rely on browserId, which is 0 for unloaded tabs
  • browsingContext.getTree throws if there is any unloaded tab, because browser.browsingContext is null for unloaded tabs
  • browsingContext.contextCreated is not emitted when an unloaded tab is added to the browser

Overall I'm unsure what the specs think about unloaded tabs. Such tabs don't have a document, so I think they don't really match the definition of a navigable per https://html.spec.whatwg.org/multipage/document-sequences.html#navigable . For the contextCreated event, it should only be emitted when the document of the context is set, which I assume is not the case for an unloaded tab?

We probably at least want to fix what's completely broken when there is an unloaded tab (eg getTree) and discuss how we want to support unloaded tabs for specific commands.

Lets get it discussed in one of the next triage meetings. Situations when this would become important is when Firefox is quit and run with the same profile again while session store is active and set to restore all tabs. While pinned tabs are loaded automatically all the others are not except the currently active tab.

Should be discussed in the working group. I will file an issue on the bidi repo.
Let's use this bug to fix the complete breakage of some commands

Points: --- → 2
Flags: needinfo?(jdescottes)
Priority: -- → P2
Summary: Support for unloaded tabs in WebDriver BiDi → Fix browsingContext.getTree with unloaded tabs in WebDriver BiDi
Whiteboard: [webdriver:backlog]
Blocks: 1730466
Flags: needinfo?(jdescottes)
Flags: needinfo?(jdescottes)
Flags: needinfo?(jdescottes)
You need to log in before you can comment on or make changes to this bug.