Bug 1862450 - Made installer changes for dual browser extension to MacOS r=mhughes

Depends on D192478

Differential Revision: https://phabricator.services.mozilla.com/D192897
This commit is contained in:
Nipun Shukla
2023-11-15 14:24:17 +00:00
parent 31a29f5cbb
commit 30cd385704
2 changed files with 29 additions and 1 deletions

View File

@@ -543,7 +543,15 @@ nsBrowserContentHandler.prototype = {
"private-window",
false
);
if (privateWindowParam) {
// Check for Firefox private browsing protocol handler here.
let privateProtocolFound = false;
let urlFlagIdx = cmdLine.findFlag("url", false);
if (urlFlagIdx > -1 && cmdLine.length > 1) {
privateProtocolFound = cmdLine
.getArgument(urlFlagIdx + 1)
.startsWith("firefox-private:");
}
if (privateWindowParam || privateProtocolFound) {
let forcePrivate = true;
let resolvedURI;
if (!lazy.PrivateBrowsingUtils.enabled) {
@@ -551,6 +559,10 @@ nsBrowserContentHandler.prototype = {
// access to private browsing has been disabled.
forcePrivate = false;
resolvedURI = Services.io.newURI("about:privatebrowsing");
} else if (privateProtocolFound) {
// We can safely remove the flag and parameter now.
const privateProtocolURI = cmdLine.handleFlagWithParam("url", false);
resolvedURI = resolveURIInternal(cmdLine, privateProtocolURI);
} else {
resolvedURI = resolveURIInternal(cmdLine, privateWindowParam);
}