¿ Launching multiple instances of Firefox ?

Hi,

I "desperately" need to launch independent instances of FireFox (each of which will use a different profile, that I select on startup).

There have been some on how to do it on Windows (pointing to http://the-edmeister.home.comcast.net/advice-html/simultaneous-profiles_versions .html).

But how would I do it on my MacBook ? What, if any, is the equivalent on OS X of the system variable mentioned in the link?

Thanks so much !

MacBook, Mac OS X (10.4.7)

Posted on Aug 4, 2006 4:26 PM

Reply
9 replies

Aug 5, 2006 10:36 AM in response to Guychi

I don't know of a way to launch multiple instances of FireFox, each using a different profile, in any manner as seamless as being able to select at startup.

However, if there are multiple user accounts on the computer, it is possible to launch separate instances of programmes in general as each user, while logged in to a single GUI account. Each instance will use the preferences of the user that that instance is launched as.

There are some limitations - some forms of interaction won't be possible between the GUI account and the other user's instance of the app, such as "drag and drop" operations. Also, "save", "open" or "download" operations by an given instance of the process will be restricted to the directories that would normally be accessible to the user that owns that process.

Try creating some extra users using the "Accounts" pref pane, then open "/Applications" > "Utilities" > "Terminal.app" and try eg. these commands (substitute an appropriate shortname and the correct path, of course; when prompted, use the password of the account to be su'd to):<pre>su otheruserShortname
/path/to/Firefox.app/Contents/MacOS/firefox &</pre>I'm not really familiar with FireFox (it's probably at about #4 or #5 on my list of favourite Mac browsers) so there may be an easier way...

Aug 5, 2006 4:35 PM in response to biovizier

It worked like a charm in my first try, but ever since I keep getting an error while trying to launch Firefox from the alternate user via the terminal:
"Close Firefox
Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

This hasn't happened before, nor does a sustem restart change anything - the error recures.

Please help.

Thanks

Aug 6, 2006 12:19 PM in response to Guychi

It looks like "Firefox" does limit you to one instance per user (throwing up that dialogue if it is already running), so if there is a need for multiple instances, a separate user will probably have to be created for each additional instance. Otherwise, as long as a given user doesn't already have an instance running, it seems to be possible to launch as that user, and for any additional users, at least on my system (I went up to five users/instances using Firefox 1.5.0.6 on Mac OS 10.4.7). Try checking with "/Applications" > "Utilities" > "Activity Monitor.app", which should list processes belonging to all users to see what users already have "Firefox" running.

Note that on the Mac, closing the last window does not automatically quit the programme.

On another note - from looking more closely at the package, it looks like the actual executable is ' firefox-bin' so it might help to try that instead of ' firefox' as I wrote in my last post.

One way to make the whole procedure into a clickable icon might be to use "AppleScript". For example, launch "/Applications" > "AppleScript" > "Script Editor.app" and paste the mini-script below (substituting an applicable username and path for FireFox):<pre style="overflow:auto; padding: 5px; width: 500px ; font-size: 10px; border:1">set theuser to "otheruserShortname"
do shell script "sudo -u " & theuser & " /path/to/FireFox.app/Contents/MacOS/firefox-bin" with administrator privileges</pre>Save the script as an "Application Bundle" (make sure none of the "Options:" checkboxes are checked) to make it "double-clickable", or else save it as a "Script", in which case it can be launched from the "Script" menu, if you have that enabled. Because of the quirks of the "do shell script" command, I can't think of a way off-hand to avoid having to have a separate launcher script for each different user instance.

The script will request an "admin" username and password. It is possible to incorporate that information into the script to avoid the need of a password dialogue, but that is considered unsafe practice since the "admin" password will be saved in the script as "clear text". Alternatively, it might be possible to avoid password entry by modifying the '/etc/sudoers' file, or by creating multiple setuid copies of "Firefox.app"...

Aug 6, 2006 1:27 PM in response to biovizier

Thanks!

Everything you wrote in your 1st msg was good. What messed it up for me is that I copied the default profile folder from my main users's ~/Library/App Support/Firefox/Profiles into the new user's one.

Only when I completely removed the new user's App Support/Firefox dir, did it revert to working well.

However, do you have an idea how I can make my existing profile (with all the extensions, bookmarks, cookies etc.) work in the alternate user's instance?

Preferably the bookmarks and extensions should be shared (via symbolic links??) but the cookies must be separate.

I really, deeply appreciate your help. You have no idea how valuable it is to my work in terms of time and agony saved.

Aug 6, 2006 4:47 PM in response to Guychi

..." I copied the default profile folder from my main users's ~/Library/App Support/Firefox/Profiles into the new user's one."...

From poking around a bit, it looks like the error message is misleading in this case - it seems to be a "permissions" issue, rather than an "in use" issue. If the copied folder isn't writable/accessible to the user (eg. if it remains owned by the original user), the error message appears. If eg. the ownership is changed to the new user, then Firefox appears to launch normally.

Given the presence of multiple users, the easiest solution might be to change the permissions of the original folder and its contents so that it is writable by everyone, before copying the folder to the other accounts. One way to do this is to control-click on the "Firefox" folder (the one in "Application Support", and choose "Get Info" from the contextual menu.

In "Get Info", expand the disclosure triangle for "Ownership & Permissions", then "Details", and change the "Access" of "Group" and "Others" to "Read & Write". Then click the "Apply to enclosed items button". Once the changes have been made, try copying the folder to the other user accounts. Alternatively, copies could be made, then for every copy, the ownership could be changed to each new user - I think it works either way, but the first method is probably easier.

Aug 7, 2006 2:33 PM in response to Guychi

I'm not sure about the extensions - I don't use Firefox that often and I don't really know how extensions work so couldn't say why one might not work. But they do seem to be working here - maybe it's a problem with specific extensions...

It should be possible to set up an AppleScript app so that its icon doesn't appear in the Dock. Try these commands in "Terminal.app" (again, substitute the appropriate paths):<pre>defaults write /full/path/to/AppleScript.app/Contents/Info LSUIElement -string 1
touch /full/path/to/AppleScript.app</pre>If the commands don't have any effect, try duplicating the AppleScript app and launching the copy - sometimes changes to the Info.plist file aren't recognized by "launch services" but a new copy would be registered right away. Note that, because of the way "do shell script" works, even if it isn't visible in the "Dock", the AppleScript app will remain running in the background (and must remain running as long as Firefox is), but should quit itself once the instance of Firefox that it launched is quit. It might be a good idea to keep an eye on "Activity Monitor.app" to make sure they aren't getting stuck or anything since with ' LSUIElement' set, there wouldn't be a way to tell.

As for differentiating the instances of Firefox belonging to different users, I can't think of a way to do this directly because of the way they have to be launched. However, since the limitation on launching mutliple instances seems to have something to do with the preferences / Application Support files, rather than on the app itself, if you can spare the drive space, I suppose you could create a whole separate copy of Firefox.app for each user (adjusting the path in the launch scripts accordingly), and use the standard "Get Info" method to give each copy of "Firefox.app" a different icon...
http://docs.info.apple.com/article.html?artnum=106873

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

¿ Launching multiple instances of Firefox ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.