Can I run FF in private mode with a command line?

User Help for Mozilla Firefox
Post Reply
vsub
Posts: 733
Joined: October 2nd, 2009, 2:20 pm

Can I run FF in private mode with a command line?

Post by vsub »

According to google,the option is "-private" but FF is not starting in private mode
firefox.exe -private -no-remote -Profile "X:\Temp\Private"
User avatar
DanRaisch
Moderator
Posts: 127188
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Can I run FF in private mode with a command line?

Post by DanRaisch »

Have you tried that with the correct syntax for launching a particular profile? "C:\Program Files\Mozilla Firefox\firefox.exe" -P "Profile Name" Note that it's -P and not -Profile.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Can I run FF in private mode with a command line?

Post by Brummelchen »

for a profile path its -profile, for a pre-defined profile via profile.ini then its -p.
anyhow both is working here (although i need to recover my last normal session after testing)

firefox.exe -private -no-remote -Profile "X:\Temp\Private"
firefox.exe -private -no-remote -p "test"

https://developer.mozilla.org/en-US/doc ... ne_Options
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Can I run FF in private mode with a command line?

Post by therube »

firefox.exe -private -no-remote -Profile "X:\Temp\Private"
Your command line should be working just fine.

(Is "firefox.exe" in your path?
If not, you'll need a full path to it.
C:\WLIB\FIREFOX\FIREFOX\firefox.exe ...)

FF is not starting in private mode
Though FF is opening?
(If so, my earlier (comment) wouldn't apply.)


Is X:\Temp\Private already opened in a non-no-remote'd session?
(No. That would give you an "already running" message.)


Did you typo "-private" as "-privat" ?
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
vsub
Posts: 733
Joined: October 2nd, 2009, 2:20 pm

Re: Can I run FF in private mode with a command line?

Post by vsub »

Here is the situation

If I run the profile with "-private" command line,the private mode icon will not appear even if I "File=>Open New Private window" and also in the "REAL" private mode,opening a new tab shows the private mode page every time but started from the command line,it displays the normal new tab page.

It's like the "-private" command line just displays the private mode first page and nothing else
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Can I run FF in private mode with a command line?

Post by therube »

In FF 52...

-private...

looks to open a private window.
it displays as private.
tabs opened in that window, appear to be private (though do not display the "private" icon).

it also appears that a new window (& any subsequent tabs), opened from the private window, are NOT private.

i did not expect that.
i expected that the entire session, opened with -private, would have been private, but (at least in 52) that appears not to be the case. maybe i've misunderstood the -private command line switch.)


it looks like the only way to get "everything" private, is to go to Options | Privacy -> History --> Never Remember History.
(which sets, user_pref("browser.privatebrowsing.autostart", true);)


SeaMonkey 2.49 looks to give the same results.
SeaMonkey looks to accept & use the browser.privatebrowsing.autostart Pref, but I don't believe they have a UI for it.


According to MDN, -private says "Opens Firefox in permanent private browsing mode. Firefox 3.6 and later only." so I'm not really understanding the behavior I'm seeing?

SUMO Private Browsing does not mention the command-line option.
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Can I run FF in private mode with a command line?

Post by therube »

And FF 64 looks to be the same.

So yes, seems I've never correctly understood what the expected behavior should be when using the -private command-line option.
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
dickvl
Posts: 54146
Joined: July 18th, 2005, 3:25 am

Re: Can I run FF in private mode with a command line?

Post by dickvl »

For me it works as expected in Firefox 64 with the -private switch and I can only open a new private window and all tab I open have the label "Private Browsing".
Firefox doesn't show the purple label in such a case just like when you use permanent Private Browsing mode (Always use Private Browsing mode), but all tabs are the PB mode tabs.
You can verify that by opening pages and check the history.
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Can I run FF in private mode with a command line?

Post by therube »

You can verify that by opening pages and check the history.
Yes, that's what I did yesterday - using History in the Sidebar.


Check again.
I just did.

At first, I thought you were right.
And I was trying to think how I saw different yesterday?


And then I realized that on the sidebar, it must not default to actually showing any "days" unless you actually expand the dropdown.
And once I expanded 'Today', I then saw sites I open in a new window, opened from the initial Private Window (at startup).
[Red herring.]


(New Profile, disabled all the spy crap stuff. [Isn't that a crock of crock, that I have to do that even before attempting to use a new Profile!] Displayed the Menu bar. Set FF to restore tabs on startup.)

You should see the sites you open show up interactively in History.
Quit FF & restart & they are still there.


A new window opened from the existing Private Window, will have Ctrl+Shift+DEL available (to clear Private Data).
[More correctly said, a non-Private Window will have Ctrl+Shift+DEL available, where a Private Window will not.]


(And that said, it appears that New Private Window does not actually open a Private Window. Color me confused.)
And then to top it off, seems that some times, at least History is not updated - as if it were a Private Window, & sometimes it is.
Something is wrong, a bug, just not sure what?
[See below.]


Win7, FF64 x64.


I'm thinking that it is a Ctrl+N shortcut from the initial Private Window is opening as a non-Private Window.
If you use File | New Private Window (& it does say, Ctrl+N), or if you use the 3-bar, New Private Window, it opens as Private.
But if you use the keyboard shortcut, Ctrl+N, or the 3-bar, New Window (rather then New Private Window, Ctrl+Shift+P), it opens as a normal window.
Bug.


Yeppers.

https://bugzilla.mozilla.org/show_bug.cgi?id=866407
Ctrl-N in private mode creates a new non-private window and restores session(if that's the configuration)

Seems in their logic, the Bug is Invalid.

Yet everything the OP said is correct, I just duplicated it - before finding the bug.
And everything they said is illogical or simply wrong (as in the wrong shortcut does display).
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Can I run FF in private mode with a command line?

Post by therube »

Seems the only reliable method to open & remain in Private Mode is to use the preference item:
> user_pref("browser.privatebrowsing.autostart", true);


(Or at least I haven't found the bug in that scenario, yet :evilgrin:.)
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Can I run FF in private mode with a command line?

Post by therube »

According to MDN, -private says "Opens Firefox in permanent private browsing mode".
Permanence is such a fleeting concept ;-).
(As is privacy.)


(Actually, if they just get rid of command-line switches, & shortcut keys, that would eliminate a whole host of problems.)
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
Post Reply