Closed Bug 1875299 Opened 8 months ago Closed 8 months ago

Use openTrustedLinkIn to open new windows in WindowManager

Categories

(Remote Protocol :: Agent, task, P2)

task
Points:
1

Tracking

(firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

(Whiteboard: [webdriver:m10])

Attachments

(1 file)

WindowManager currently uses browser.js' OpenBrowserWindow which mostly forwards to BrowserWindowTracker.openWindow.
This API does not allow to pass a userContextId at the moment, so the only way to create a window and ensure the first tab is created in a specific usercontext is to build a full window arguments array, which is very verbose and fragile.

URILoadingHelper.openTrustedLinkIn exposes a better API and allows to set a user context id easily. Some potential issues:

  • it resolves later than openWindow so some of the events we are waiting are no longer needed (might cause race conditions with existing code)
  • the new window is focused, which is something we currently do as well in WindowManager. But by spec we should not run the focus steps by default, so we might have to change the helper to accommodate that

Try push at https://treeherder.mozilla.org/jobs?repo=try&revision=c26496517219f0f6e1f7d88cbce38e5674e5b663

openTrustedLinkIn allows to specify additional parameters such as the userContextId which is useful to support user context features in
webdriver bidi.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Duplicate of this bug: 1875290

We can also use this opportunity to switch to about:blank as the URL of the initial tab for new windows.

(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from Bug 1875290 comment #1)

(In reply to Julian Descottes [:jdescottes] from Bug 1875290 comment #0)

Should we force about:blank for the initial tab of new windows as well? We could keep this specific to WebDriver BiDi if needed?

It shouldn't matter which kind of context we are trying to open here. So in short, yes we should do.

Severity: -- → S3
Points: --- → 1
Priority: -- → P2
Whiteboard: [webdriver:m10]
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3cb5e9723b0c [remote] Use openTrustedLinkIn in WindowManager.openBrowserWindow r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: