File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 232232 <string >file</string >
233233 </array >
234234 </dict >
235+ <dict >
236+ <key >CFBundleURLName</key >
237+ <string >Firefox Protocol</string >
238+ <key >CFBundleURLSchemes</key >
239+ <array >
240+ <string >firefox</string >
241+ </array >
242+ </dict >
243+ <dict >
244+ <key >CFBundleURLName</key >
245+ <string >Firefox Private Browsing Protocol</string >
246+ <key >CFBundleURLSchemes</key >
247+ <array >
248+ <string >firefox-private</string >
249+ </array >
250+ </dict >
235251 </array >
236252 <key >CFBundleVersion</key >
237253 <string >@MAC_BUNDLE_VERSION@</string >
Original file line number Diff line number Diff line change @@ -543,14 +543,26 @@ nsBrowserContentHandler.prototype = {
543543 "private-window" ,
544544 false
545545 ) ;
546- if ( privateWindowParam ) {
546+ // Check for Firefox private browsing protocol handler here.
547+ let privateProtocolFound = false ;
548+ let urlFlagIdx = cmdLine . findFlag ( "url" , false ) ;
549+ if ( urlFlagIdx > - 1 && cmdLine . length > 1 ) {
550+ privateProtocolFound = cmdLine
551+ . getArgument ( urlFlagIdx + 1 )
552+ . startsWith ( "firefox-private:" ) ;
553+ }
554+ if ( privateWindowParam || privateProtocolFound ) {
547555 let forcePrivate = true ;
548556 let resolvedURI ;
549557 if ( ! lazy . PrivateBrowsingUtils . enabled ) {
550558 // Load about:privatebrowsing in a normal tab, which will display an error indicating
551559 // access to private browsing has been disabled.
552560 forcePrivate = false ;
553561 resolvedURI = Services . io . newURI ( "about:privatebrowsing" ) ;
562+ } else if ( privateProtocolFound ) {
563+ // We can safely remove the flag and parameter now.
564+ const privateProtocolURI = cmdLine . handleFlagWithParam ( "url" , false ) ;
565+ resolvedURI = resolveURIInternal ( cmdLine , privateProtocolURI ) ;
554566 } else {
555567 resolvedURI = resolveURIInternal ( cmdLine , privateWindowParam ) ;
556568 }
You can’t perform that action at this time.
0 commit comments