by bluebarbet · 1y ago · 0 comments
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.
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.
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.)
https://addons.mozilla.org/en-US/firefox/addon/containerise/
> ...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.
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...
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.
That's interesting. It didn't work a couple of years ago, perhaps it's been fixed.
Still leaves that initial GUI profile setup.
./firefox -CreateProfile "profile-name /home/user/.mozilla/firefox/profile-path/" -CreateProfile "profile-name"
also works and will use the default profile path.In my case, I am able to launch several Firefox instances with distinct profiles.
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.
edit: I use Simple Tab Groups which is far more featureful - "Send tab to [group/container/etc]" for example is table stakes.
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
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.
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).
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.
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:
A single "Send to profile" option would be such a boon to productivity.
Otherwise it tends to just spawn a new window in the existing instance.
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.
PS: probably. It's possible there was a fix. The GUI setup remains unscriptable.
>>`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.