Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Profiles are great. I've used them for years. Much better than containers, which separate your data sort-of-but-not-quite. A profile folder has everything. You can copy it, back it up, plug it into a completely new Firefox installation later.

That portability is a killer feature, but scriptability needs to be improved. The manual says you can do:

>`firefox --profile <path> Start with profile at <path>`

But that will not work as expected if you have more than one profile (which is the whole point). At present the only workable solution is to fiddle with a GUI thru `about:profiles` (or `firefox --ProfileManager`) in order to create the profiles and give them all-important UIDs. And then do:

>`firefox -P <UID>`

It may seem small, but I've found that this is a serious roadblock. I wish it could be fixed so as to make profiles entirely scriptable.

PS: to be clear, after the futzing with the GUI to create the profiles, my script works (well!) at opening windows in the right profile, this way: (1) Check if the given profile is already launched: `ps -eo args | grep -E ".(firefox).(-P $UID)" | grep -v grep > /dev/null` (2) Do `firefox -P $UID --new-instance $url` if it isn't, and `--new-tab` if it is. Inelegant, but very reliable.



> Much better than containers, which separate your data sort-of-but-not-quite

What is better depends on the use case. For me, containers are magic, because I can be logged into eg 2-3 different microsoft accounts simultaneously in the same window. With profiles or other browsers I would need to open a different window for each, which would be unnecessary and impractical. This is extremely convenient for me, containers is the feature I cannot currently browse without. Sometimes "separate your data sort-of-but-not-quite" may be exactly what you may need.


This combined with "Always Open Site in Container", that pins a site to a specific container makes it almost invisible to me when moving between profiles.

I have several sites I only want to open with specific profiles and this workflow is a pain with Chrome. (click link with wrong profile, copy url, close tab, open a new browser, select profile, paste url, open site with correct profile.)


I really like the "Always Open Site in Container" along with "Limit to Designated Sites" once it's set up, but I wish there was a way to make it accept wildcards otherwise I have to manually add localhost:8080, localhost:8081, etc. Manually adding a dozen or more becomes painful.


It’s so odd that there is no way to edit the list of sites manually. Now, the only way to ”Always Open Site in Container” is to first browse to that page. That’s not just inconvenient for batch edits, what’s worse is that you can end up in a redirection deadlock, with no chance to edit which container the first url should open in.


Does the Containerise extension do what you want? I've used it in the past for wildcard subdomains but not for ports.

https://addons.mozilla.org/en-US/firefox/addon/containerise/


I have come across that one, but not having the "trusted" badge in the extension store has usually been a hard pass for me. I might reconsider.


I find that for dev workflows (even outside firefox containers) to not mix up badly, you end up needing to split localhost anyway - so for example, binding to specific IPs inside 127.0.0.1/8 (it's a whole /8, you're usually not running out of that), or, depending on how badly you need ::1/IPv6 bindings, service.localhost6 or service.localhost6.localdomain6 style names instead of just localhost.


Agree, containers are exactly what I want and I use them all the time. Profiles are too much isolation, like installing separate VMs to run processes in a completely isolated way when something like Docker is fine.


The key element here is switching windows across profiles. Safari almost gets this right but fails in the UI imho. Edge has "workspaces" that could almost work but they don't provide isolation.


Zen [0] can bridge that gap. I have it set up so that each workspace in practice maps to a specific container.

[0] https://zen-browser.app/


Yes, Zen is extremely good at that. Alas, as it is using Firefox Sync it doesn't sync your sidebar states (yet).


Today is the day I no longer need to open a private browser to manage Entra. Thank you stranger, thank you very much


My biggest struggle with containers is that I constantly accidentally shift out of them without noticing. I never remember that the default "new tab" keyboard shortcut doesn't respect the current container.


In Windows 10 I have shortcuts pinned to my taskbar that are just

> ...firefox.exe" -P "profilename"

and then `taskbar.grouping.useprofile true` so only windows from the same profile are grouped together and some custom recolored Firefox icons for those pinned shortcuts and custom per-profile userChrome.css styling (#TabsToolbar background-color) for easy visual differentiation of a window's profile.

For Windows 10, no scripting is needed. Just the initial GUI profile setup.

> ...firefox.exe" -P "profilename" "https://www.example.com"

from terminal works exactly as expected regardless of how many profile instances are currently running or their state.

You can even have multiple versions of Firefox installed and point them at different profiles. I have some profiles on ESR and some on Standard.


Is there a command line flag that opens the url in a chromeless window for Firefox, so that it works like a PWA?


I haven't messed with Firefox's PWA feature/taskbar-tabs[1] but it seems like under the hood it's just using shortcuts so you're probably looking for -taskbar-tab

This redditor looks like he's doing close to what you're asking with the caveat of needing an entry in taskbartabs.json to use -taskbar-tab (and maybe Windows OS only) [2]

I don't think it's completely chromeless but you can probably hide everything via custom CSS:

ctrl+shift+i (dev tools) -> f1 (settings)

check advanced settings:

  enable browser chrome and add-on debugging  

  enable remote debugging  
ctrl+shift+alt+i (browser dev tools)

Find element IDs or class names and try out CSS rules to your heart's content.

Set toolkit.legacyUserProfileCustomizations.stylesheets = true and put your changes in Firefox/Profiles/$profilename/chrome/userChrome.css.

Remember to turn off the advanced settings when you're done.

[1] https://firefox-source-docs.mozilla.org/browser/components/t...

[2] https://www.reddit.com/r/firefox/comments/1ljidwp/progressiv...


Cannot get this to work with Win11, whose taskbar won't accept the same program pinned twice. Even not, after creating two shortcuts.


For Win 10, I set this up a while ago so my memory is a bit fuzzy but the key was the `taskbar.grouping.useprofile true` setting. I think after that's set Firefox and Windows did some AUMID shenanigans on profile launch.

I just made a new profile as a test and this is what I did:

  ...firefox.exe" -P -> create a new profile (ie. "newprofilename")
  
   about:config set `taskbar.grouping.useprofile = true` (when I originally did this for many profiles I believe I copied prefs.js that already had it set)  

   close and reopen that profile instance. I used ...firefox.exe" -P "newprofilename" but any method of launching the profile should work. It should now be in a separate taskbar group.  

  Pin that new group to taskbar. Also modify its shortcut target to add -P "newprofilename"  

  Now you're done.  
Normally I also renamed the pinned shortcut to something sane and then I changed the icon. I took the normal Firefox icon (I think w/ GIMP) and just messed with the colors via saturation or something so it was easy to tell the difference. I remember changing the shortcut icon had some headache but I sadly didn't write notes.

Also, I didn't set grouping.useprofile on all my profiles, just the profiles I wanted separately pinned on my taskbar. My default profile is pinned normally without grouping.useprofile set.


Weird this works for Edge with two different profiles.


I do this on Linux (Mint) and it works as expected.


>from terminal [opening URLs in instances using profile paths] works exactly as expected regardless of how many profile instances are currently running or their state.

That's interesting. It didn't work a couple of years ago, perhaps it's been fixed.

Still leaves that initial GUI profile setup.


You don't need GUI to create profiles.

   ./firefox -CreateProfile "profile-name /home/user/.mozilla/firefox/profile-path/"


This is a good catch and does indeed work.

  -CreateProfile "profile-name"
also works and will use the default profile path.


Keep it mind, though, if you don't specify path, the profile directory name would be:

    random_string + '.' + "profile-name"
That could prove inconvenient for navigation.

If you want predictable, non-random directory names, you'll have to specify it.


Useful. This is not documented in the manfile or command help text, at least for the ESR release.


Have you tried `firefox --no-remote --profile <path>`?

In my case, I am able to launch several Firefox instances with distinct profiles.


Note that `--no-remote` breaks starting new browser windows from outside, which users normally want.

I'm starting to think that setting the `HOME` environment variable is the only way to really make things isolated - this still won't handle `~insertusernamehere` but basically everything else respects it.


--no-remote doesn't do anything anymore. It was removed about a year ago if memory serves.


I do `open -n "/Applications/Firefox.app" --args -p myprofilename` and that does the trick on mac


On windows powershell I do Start-Process "C:\Program Files\Mozilla Firefox\firefox.exe" -ArgumentList "-P default-release" Which is the exact same idea.


How does that integrate with the "Dock" or menu bar at the bottom? (new to Mac)


Yes, I tried that and everything else. Either it refuses to launch with `--new-instance` or (from memory, in the case of your command) subsequent `--new-tab`s may open in the wrong profile. Presumably due to the order in which the original instances were created. The point is that the system turns on these UIDs, which are not paths or even hashes of paths.


Tried containers when it was released but found it very inconvenient to manage. If I understand this solution doesn't even let you have two profiles open at once? That's even less useful imho.

edit: I use Simple Tab Groups which is far more featureful - "Send tab to [group/container/etc]" for example is table stakes.


Of course you can have them open at once, that's what's useful. I have four! And I can open subsequent windows in the right profile, no problem. But it required non-trivial scripting.


I personnally went for extensions using them. I downloaded, Google, Facebook, Amazon, Youtube containers extensions.

I have had issues with Youtube and Google together. I think I solved it using the "Don't track me Google extension" but I am not so sure anymore


I have 3 different profiles, one for each of my current customers and one personal.

Within the customer profiles, I have containers for things like different AWS accounts (although AWS now has that as part of the console), I can have logins to test systems and production systems etc.

The automation of containers is good too, tied to URLs.


> A profile folder has everything. You can copy it, back it up, plug it into a completely new Firefox installation later.

These new profiles seem to be slightly different from the old ones?

[edit: ignore most of the stuff below, see replies]

The new UI doesn't show your other regular profiles and when you create a new profile via the new UI, it also doesn't create a separate profile folder (it's part of your active profile). They're like sub profiles... probably to allow everything to be synced via a Firefox account?

We can still move the profile folder. The difference is that what's created with the new UI is part of that folder (the old about:profiles page is still there and old style profiles are still supported).


It still creates separate folders but you're right that about:profiles seems to treat them as the same.

When you open about:profiles in both your "new" profiles, you can see that even though it has the same name, the path changes.

So I think in effect they still behave like profiles before, just with some extra logic on top so they have names, icons and so on.


You're right. For some reason I couldn't see the folders being created, but after restarting Firefox (about:profiles required me to do after creating profiles with the new UI), they are created.

Do you know if there's any way to have old profiles showing on this new UI?

Edit: They seem to be working on this:

- https://bugzilla.mozilla.org/show_bug.cgi?id=1996240

- https://phabricator.services.mozilla.com/D270525


Another roadblock that I've encountered is moving a tab between profiles. For a multitude of reasons, foremost between them research, I would often come across a tab that I know would be useful for one of my other research subjects. If the profile in question is closed, there is too much friction to open it, copy the url, paste into a new tab, then close the profile again.

A single "Send to profile" option would be such a boon to productivity.


Tip: Use --no-remote to run a second instance of Firefox with a separate profile.

Otherwise it tends to just spawn a new window in the existing instance.


> But that will not work as expected if you have more than one profile (which is the whole point). At present the only workable solution is to fiddle with a GUI thru `about:profiles` (or `firefox --ProfileManager`) in order to create the profiles and give them all-important UIDs.

FWIW, that's only true if you care about it having those IDs and being exposed to the graphical interface. If you don't, then you can just run `firefox --profile $HOME/.mozilla/firefox/whatever` and it works. I use a small shell script™ wrapper to run firefox this way and it's quite nice. Also helpful: If you run firefox like that, you can just point it at a new empty directory and it'll populate it as a profile, so it's easy to make new ones too.


But that script won't work if you need to open subsequent new windows in particular profiles.

PS: probably. It's possible there was a fix. The GUI setup remains unscriptable.


Ah, right. TBH I mostly just don't do that, but I did throw together a script that takes a URL and just puts it on the clipboard and uses notify-send to tell you about it, so I can just paste into whichever window I want (and then tell the system that that script is my preferred "browser" to open http(s) URLs). This obviously adds a little friction, but it makes it trivial to open links in any browser/profile/window/tab-group I want.


> The manual says you can do:

>>`firefox --profile <path> Start with profile at <path>`

>But that will not work as expected if you have more than one profile (which is the whole point).

What won't work? Is that specific to Windows? This just works fine on my Linux box.


Unfortunately I don't think you can just transfer willy nilly between firefox versions, at a certain point downgrades don't work, and I'm just trying to figure out where that point is (can you move to ESR for example)


My script uses `firefox-esr --allow-downgrade` for exactly that reason. It worked in my case.


Yessss, I've been wondering how to script different FF profiles (just haven't had enough time/motivation). That was the only thing holding me back from making it my daily driver.


A roadblock to what workflow? I just have -p in my firefox shortcut and it shows the profile manager every time I launch. I have 6 profiles I use regularly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: