Remix.run Logo
bluebarbet 11 hours ago

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.

Brybry 8 hours ago | parent | next [-]

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.

bluebarbet 41 minutes ago | parent | next [-]

>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.

mbeex an hour ago | parent | prev | next [-]

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

jack_tripper 26 minutes ago | parent [-]

Weird this works for Edge with two different profiles.

dare944 8 hours ago | parent | prev [-]

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

yjftsjthsd-h 2 hours ago | parent | prev | next [-]

> 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.

bluebarbet an hour ago | parent [-]

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.

conaclos 10 hours ago | parent | prev | next [-]

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

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

o11c 10 hours ago | parent | next [-]

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.

glandium 6 hours ago | parent [-]

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

rc_kas 7 hours ago | parent | prev | next [-]

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

UltraSane 4 hours ago | parent [-]

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

bluebarbet 10 hours ago | parent | prev [-]

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.

celsoazevedo 8 hours ago | parent | prev | next [-]

> 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).

Yaina 8 hours ago | parent [-]

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.

celsoazevedo 7 hours ago | parent [-]

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

ghostly_s 10 hours ago | parent | prev | next [-]

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.

bluebarbet 10 hours ago | parent | next [-]

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.

cassepipe 9 hours ago | parent | prev [-]

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

10 hours ago | parent | prev | next [-]
[deleted]
alex1138 an hour ago | parent | prev [-]

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)

bluebarbet an hour ago | parent [-]

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