Starting Firefox with a specified profile from the dock (Mac OS X)

All we need is an easy explanation of the problem, so here it is.

I have different Firefox profiles for each version I have installed on my system and I know I can specify the profile name I want to use like this:

/Applications/Minefield.app/Contents/MacOS/firefox-bin -P minefield

Is it possible to create a dock icon or alias with additional parameters (just like in this article with shortcuts on windows)? That way I could have as many profiles as I want and wouldn’t see the profile manager everytime I start the browser.

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

It’s a bit more work to do this on mac but this is what you want:

Managing Multiple Firefox Profiles in OS X (via Internet Archive WayBackMachine)

The custom Firefox icons are still available from Gnome-Look.org

Method 2

Script Editor based solution was quite slow for me, so I looked for an alternative.

I ended up creating an application bundle with a bash script inside – see details at Using Firefox profiles on Mac OS X.

Method 3

Here in the future I run multiple Firefoxes, each with unique Dock icons, app names, and unique & separate user profiles.

My motivations

  • to have multiple GMail, Twitter, Github etc. accounts simultaneously logged-in
  • to group websites by concept: coding, comms, news, finance, video, music
  • to label them by concept /Applications and the tab-switcher, and provide unique visual identity with different MacOS .icns file
  • to bucket my cookie exposure, in order to avoid over-sharing my movements about the internet with le Goog, social media, and advert tracking firms

How I did it

1. Copy Firefox (bulky at 360GB per copy, I know, but haven’t found another viable option, see below)

  • Duplicate /Applications/Firefox.app using Cmd-D or sudo cp -r ...
  • Rename the new app folder from Firefox copy.app to whatever, FF Proxied.app in my case

2. Give your FF copy a new visual identity

  • Change the icon by right-clicking FF Proxied.app and clicking Get Info, then drag your new icon onto the Firefox icon, replacing it. Close the Get Info dialog
  • [You can create a .icns file using Python console script generate-iconset made by retif. Be sure to start from a square PNG image, and I use GIMP to turn background into transparency by adding an alpha channel.
  • Change the app label (displayed in macOS’s menubar) by editing FF Proxied.app/Contents/Resources/en.lproj/InfoPlist.strings and changing its contents from CFBundleName = "Firefox"; to CFBundleName = "FF Proxied";

3. Give your FF copy its own user profile

  • I mkdir mine under ~/ff_profiles, and you may want to create a similar top-level folder for your FF profiles
  • mkdir ~/ff_profiles/proxied (for example)
  • Start FF Proxied in Profile Manager, like so-
    $ /Applications/FF\ Proxied.app/Contents/MacOS/firefox --ProfileManager
    
  • Once in Profile Manager dialog-
    • click Create Profile...
    • click Continue
    • name the profile whatever
    • click Choose Folder...
    • navigate to the folder you just mkdir‘d, then click Open
    • click Done
    • Back in the Profile dialog, ensure the profile you just created is highlighted, and that you’ve checked the checkbox [X] Use the selected profile without asking at startup
    • now click Exit

4. Add your new FF copy to the Dock

  • in Finder, navigate to FF Proxied (or whatever you named yours), and drag it onto the Dock

5. Test it

  • click your "new app" on the Dock

Upsides

  • separate app instances
  • separate visual identities (icons, labels)
  • provides a fairly durable and concept-limited container for groups of websites
  • I no longer hunt for open tabs anymore (yes I used the switch to tab feature before this, but that doesn’t solve the concept-grouping need)
  • better than all the tab and window organizer extensions I’ve tried on both FF and Chrome

Downsides

  • more disk space consumed
  • each copy will prompt you update when new versions come (but each copy does indeex update only its own copy)
  • the overhead of running multiple FF instances
  • you have to set up preferences from scratch for each FF copy
    • I tried copying prefs folders, but they appear to have baked-in whatever path they were created on, annoyingly

Other options I tried

  • Platypus: no joy; it’s meant for CLI scripts, not GUI apps
  • Script Editor: same experience as @Nickolay (above)
  • Firefox’s Multi-Account Containers extension? Not in my experience, because-
    • a domain name can belong only to a single container
    • therefore having several gmail.com’s open doesn’t work very well
    • opening new tabs for a container is awkward
    • the extension doesn’t seem to manage cookie separation very well, and sometimes I find that a site I logged into on one tab, will not be logged in when I visit the same site in a new tab
  • Symlinking all but the menubar label file (FF Coding.app/Contents/Resources/en.lproj/InfoPlist.strings)
    • This runs into a weird bug where Firefox cannot access files under symlinked folders, e.g. …/Content/Resources/omni.ja (zipfile archive apparently containing Firefox’s JS chrome code)
    • see my attempt at a Firefox symlinker script here
    • If the symlink bug was fixed, symlinked clones of Firefox would mainly cost the diskspace for the .icns file, folders & symlinks, and InfoPlist.strings

All corrections & suggestions will be appreciated.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply