Closed Bug 1875524 Opened 2 years ago Closed 8 months ago

Add a "WindowManager.supportsWindows()" helper to more easily check for multiple windows support

Categories

(Remote Protocol :: Agent, enhancement, P3)

enhancement

Tracking

(firefox141 fixed)

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: whimboo, Assigned: speneth1, Mentored)

Details

(Whiteboard: [lang=js][webdriver:m16][webdriver:external][webdriver:relnote] )

Attachments

(1 file)

Filed based on the discussion in the following Phabricator revision:
https://phabricator.services.mozilla.com/D199066#inline-1104049

To ease the checks for Marionette and WebDriver BiDi if on a given platform new windows are supported we should have a supportsWindows() method in the WindowManager module, which would be similar to TabManager.supportsTabs().

With that helper command added we could simplify the checks in Marionette (WebDriver:NewWindow command) and WebDriver BiDi (browsingContext.create command) to have something like:

let type;
if (typeHint == "tab" && supportsTabs() || typeHint == "window" && supportsWindows()) {
  type = typeHint;
} else if (lazy.TabManager.supportsTabs()) {
  type = "tab";
} else if (lazy.WindowManager.supportsWindows()) {
  type = "window";
} else {
  // throw appropriate error
}
Mentor: hskupin
Priority: -- → P3
Whiteboard: [lang=js]

Hi, it's been some time, but may I take on this bug if it's still available?

Flags: needinfo?(hskupin)

Yes, it's available given that no-one else commented on the bug recently and no patch is attached. So feel free to pick it up. Thanks!

Flags: needinfo?(hskupin)
  • Added supportsWindows method to WindowManager.
  • Refactored type selection in browsingContext.create to use an if/else block
    that uses supportsTabs and supportsWindows to determine the type.
  • Removed the supportsTabs check from the "tab" case as the same check is now
    performed in the type selection if/else block.
Assignee: nobody → speneth1
Status: NEW → ASSIGNED

Hi Spencer, I wanted to check back with you if you would have the time currently to update the reviewed patch. If it takes longer then no worries. Thanks.

Flags: needinfo?(speneth1)

Hi Henrik,

Apologies for the delay, life got busy and had to take a step back for a while. Starting from around this time next week I'll be able to sit back down and work on it. If that's no trouble despite the time, then I will take a look at it then.

Thanks,
-Spencer

Flags: needinfo?(speneth1)
Attachment #9471294 - Attachment description: Bug 1875524 - [Remote Protocol] Add a "WindowManager.supportsWindows()" helper to more easily check for multiple windows support. r=whimboo → Bug 1875524 - [remote] Add a "WindowManager.supportsWindows()" helper to check for multiple window support
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a842a70b6fc0 https://hg.mozilla.org/integration/autoland/rev/c0044be83c85 [remote] Add a "WindowManager.supportsWindows()" helper to check for multiple window support r=whimboo,webdriver-reviewers
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch

Thank you Spencer for getting this feature added! Please let us know if you have interest to work on some other bug - or just find one yourself.

Whiteboard: [lang=js] → [lang=js][webdriver:m16][webdriver:external]
Whiteboard: [lang=js][webdriver:m16][webdriver:external] → [lang=js][webdriver:m16][webdriver:external][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: