Closed Bug 1745208 Opened 4 years ago Closed 4 years ago

[utilityOverlay] Make openLinkIn be able to open non-private windows if necessary

Categories

(Firefox :: Tabbed Browser, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: julienw, Assigned: julienw)

References

Details

Attachments

(3 external files, 1 obsolete file)

Currently openLinkIn and friends will reuse the current window's private browsing status by default. We can pass private: true to force a private window, but currently we can't force a non-private window.

Blocks: 1639716

Hey Gijs,
I'd like to know what you think of this approach.
This patch along with https://phabricator.services.mozilla.com/D133375 makes it possible to implement https://phabricator.services.mozilla.com/D129518.

If that's OK I'd be happy to look at tests next. Pointers welcome for these too!

Thanks!

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Julien Wajsberg [:julienw] from comment #4)

Hey Gijs,
I'd like to know what you think of this approach.
This patch along with https://phabricator.services.mozilla.com/D133375 makes it possible to implement https://phabricator.services.mozilla.com/D129518.

If that's OK I'd be happy to look at tests next. Pointers welcome for these too!

Thanks!

I think you could skip the first two patches and just have openLinkIn call BrowserWindowTracker directly to allow looking for non-private windows? It doesn't seem to me like the level of indirection through getTopWin is really adding much. There could even be a follow-up to get rid of it entirely, as there aren't that many consumers: https://searchfox.org/mozilla-central/search?q=getTopWin( .

The adding of the parameter looks pretty good to me. In terms of a unit-test, it should be pretty straightforward - you can use BrowserTestUtils.waitForNewWindow to check for the new window in the test, and check that the promise from openLinkIn resolves with the same browser. Where to put it might be the most difficult question... anything other than browser/base/content/test/general/ would be nice, but I don't think we currently have browser tests for utilityOverlay.js specifically. Might just want to be a new subdirectory as a sibling of general ?

Flags: needinfo?(gijskruitbosch+bugs)
Attachment #9255959 - Attachment description: WIP: Bug 1745208 - [utilityOverlay] Add new tests for openWebLinkIn r=gijs! → Bug 1745208 - [utilityOverlay] Add new tests for openWebLinkIn r=gijs!
Attachment #9254567 - Attachment description: WIP: Bug 1745208 - [utilityOverlay] Make getTopWin take an option parameter r=gijs! → Bug 1745208 - [utilityOverlay] Make getTopWin take an option parameter r=gijs!
Attachment #9254569 - Attachment description: WIP: Bug 1745208 - [utilityOverlay] Add a new parameter "forceNonPrivate" to openLinkIn r=gijs! → Bug 1745208 - [utilityOverlay] Add a new parameter "forceNonPrivate" to openLinkIn r=gijs!
Pushed by jwajsberg@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ce392c52141a [utilityOverlay] Add new tests for openWebLinkIn r=Gijs https://hg.mozilla.org/integration/autoland/rev/8823453f3682 [utilityOverlay] Make getTopWin take an option parameter r=Gijs https://hg.mozilla.org/integration/autoland/rev/d2696f5ebb6c [utilityOverlay] Add a new parameter "forceNonPrivate" to openLinkIn r=Gijs
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Attachment #9254568 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: