Bug 802274 - Set the autostart pref when launching Firefox with the -private command line option; shoulder-r=jdm
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 16 Oct 2012 21:40:30 -0400
changeset 110630 9343aa86ae7ebde5a865fa3da0ab22f5d7047e82
parent 110629 31642ee5a1c91900b7a955134d3a8245aa7226f0
child 110631 e03f63abb826e42f90a43a5166dcdd961a83d79c
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs802274
milestone19.0a1
Bug 802274 - Set the autostart pref when launching Firefox with the -private command line option; shoulder-r=jdm
browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
--- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
@@ -461,16 +461,17 @@ PrivateBrowsingService.prototype = {
       case "command-line-startup":
         this._obs.removeObserver(this, "command-line-startup");
         aSubject.QueryInterface(Ci.nsICommandLine);
         if (aSubject.findFlag("private", false) >= 0) {
           // Don't need to go into PB mode if it's already set to autostart
           if (this._autoStarted)
             aSubject.handleFlag("private", false);
 
+          Services.prefs.setBoolPref("browser.privatebrowsing.autostart", true);
           this.privateBrowsingEnabled = true;
           this._autoStarted = true;
           this._lastChangedByCommandLine = true;
         }
         else if (aSubject.findFlag("private-toggle", false) >= 0) {
           this._lastChangedByCommandLine = true;
         }
         break;