launching "firefox -private" if firefox is already launched modifies the behavior of "-new-tab" and "-private-window" command line flags
Categories
(Firefox :: Private Browsing, defect, P3)
Tracking
()
People
(Reporter: bugzilla, Unassigned)
References
Details
Updated•8 years ago
|
Updated•3 years ago
|
Comment 3•2 years ago
|
||
This issue is still valid!
Using Firefox 121.0.1 on Linux.
If I have a running instance of Firefox with a non-private window open and I run firefox --private-window https://example.com the URL is simply opened in a new tab of the existing non-private window. Nothing is printed to the command line output about Firefox doing something different than what the command asked for. This is pretty confusing and if not paying attention the user can assume he's browsing in private mode but they're not.
If I already have a private-window open and that window was the last focused one then firefox --private-window https://example.com opens the URL in the private window.
It looks like the --private-window command line argument only has an effect if used alone to start a blank new private window and is simply ignored in other cases.
If I run firefox --private-window ; firefox https://example.com then the first part of the command will open a new private window and the second part of the command will open a new tab in the private window with the URL. But this feels very wrong and ends up with an unnecessary empty tab opened.
This feels like the command line is simply broken.
There have been several related bugs around this opened/closed and regressions observed over the years (e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=1442749 , https://bugzilla.mozilla.org/show_bug.cgi?id=1598290 ...). I also found https://bugzilla.mozilla.org/show_bug.cgi?id=1445674 which acknowledges the fact that this area isn't properly tested. I assume there is some complexity related to this that I don't grasp but I feel this is something that should be addressed somehow. Any chance this could be prioritized?
Comment 4•2 years ago
|
||
I think this is related to the Firefox launcher. Ray, could you provide your insight here? Thanks.
Comment 5•2 years ago
|
||
Exceedingly unlikely. The launcher process' involvement is over and done with before we pass any data to an already-open instance of Firefox, and it doesn't process the -private flag. [1] Also, we didn't have a launcher process in Firefox 32.
[1] (The only place in the entire application that I can find where the -private flag is processed is here, in BrowserContentHandler.sys.mjs. The comments there reference a "global PB Service" that also uses it, but I don't know of such a thing.)
Comment 6•2 years ago
|
||
Note that I was not using -private at all in my tests, only --private-window
Comment 7•2 years ago
|
||
Looking at the code in https://searchfox.org/mozilla-central/source/browser/components/BrowserContentHandler.sys.mjs#88-117 I played around with launcher arguments and figured something that looks to work, at least on Linux: firefox --private-window firefox-private:https://example.com does what I wanted: open the provided URL in a private window. But I could not find any documentation anywhere about this. If this even expected? Won't this break in the future if this area is taken care of?
Comment 8•2 years ago
|
||
FWIW this also seems to work: firefox --private-window firefox:https://example.com
Comment 9•2 years ago
|
||
Apparently firefox: and firefox-private: protocols are added for dual browser extension (bug 1862450). Don't ask me what is dual browser extension. That's what I want to ask. Mozilla becomes more and more secretive.
Comment 10•2 years ago
|
||
(In reply to Paul Merlin from comment #6)
Note that I was not using
-privateat all in my tests, only--private-window
Ah! The bug title specifies "firefox -private", so I'd assumed you had run that prior to the tests in that comment. I'd say you're describing a different bug than this one. Note in particular that the original reporter says that firefox -private-window http://example.com works correctly before invoking firefox -private!
In particular, I suspect you've hit a much more recently-introduced bug. Can you use mozregression to check if so, and possibly isolate the regression point? (mozregression creates and runs a series of temporary Firefox installations; but the location of those installations should be printed out in the bottom pane of the mozregression GUI window, so you should be able to invoke them directly from a terminal window.)
For what little it's worth: I have just tested on Windows, both with my current install of Firefox and via mozregression, and can't repro here.
(In reply to Paul Merlin from comment #7)
But I could not find any documentation anywhere about this.
I'm with :emk about this — I have no idea what's going on here, and I wouldn't rely on it long-term. (But it should be fine for a temporary workaround.)
Comment 11•2 years ago
|
||
Yep I confirmed that I don't observe the bug on Windows earlier Today.
It is definitely present on Linux (Ubuntu default Firefox install, snap I believe).
mozregression looks nifty but this raises a few questions.
What version should I use as a boundary for the bisect?
The bug happens when running from the command line while there's already an instance running, I don't see any option in mozregression to help me find the culprit, any tips?
Comment 12•2 years ago
|
||
(In reply to Paul Merlin from comment #11)
Yep I confirmed that I don't observe the bug on Windows earlier Today.
It is definitely present on Linux (Ubuntu default Firefox install, snap I believe).
... I can all too easily see this being a snap-related bug.
mozregressionlooks nifty but this raises a few questions.
What version should I use as a boundary for the bisect?
We don't actually know if this is a regression at all, so the default of "one year ago" is probably fine; but you can set it to four years ago for the cost of only two additional bisections.
The bug happens when running from the command line while there's already an instance running, I don't see any option in
mozregressionto help me find the culprit, any tips?
On each bisection, mozregression will start a new instance of firefox, so that'll be the "while there's already an instance running" criterion satisfied. You can then copy the path to that instance's executable from the bottom pane of the GUI window, paste it into a separate console window, and append the necessary arguments to perform the actual test.
Updated•1 year ago
|
Comment 13•9 months ago
|
||
(In reply to Paul Merlin from comment #8)
FWIW this also seems to work:
firefox --private-window firefox:https://example.com
Unfortunately, it or firefox-private: doesn't seem to work anymore (v136.0.3). From what I'm reading, it looks like it was the only workaround.
Description
•