5

I use different Firefox profiles for different things. (This is Firefox 16.0.2) I have one general-purpose profile that I use for normal web browsing, plus some others for other things (e.g., javascript hacking). What I want to have is two shortcuts: one that opens the general-purpose profile and one that opens the profile manager so I can choose among the other profiles. However, I want the general-purpose profile set as the default, so that if some other program tries to open a link and I don't have any Firefox windows open, it always opens the general profile.

I can't figure out how to do this. It seems that if you open the profile manager, you cannot avoid changing the current setting of what is the "default profile".

For instance, suppose I have two profiles, "general" and "other". Looking in profiles.ini I see that "general" is set as the default profile. All is well and good. I use my profile-manager shortcut and open the profile manager. I want to select the "other" profile. But there is that checkbox for "Don't ask at startup", and it cramps my style. If I check it, it opens "other" and sets that as the default profile. If I don't check it, it removes the default setting on the "general" profile and leaves me with no default, so if a program tries to open a link, it will take me to the profile manager. Neither of these is what I want. What I want is to open the "other" profile while leaving "general" as the default.

Basically, the "don't ask at startup" checkbox seems to force between two choices: open a profile and set it as default, or open a profile and make it so there is no default profile. But I want a third option: open a profile while leaving the default profile set to whatever it's already set to. Is there any way to accomplish this?

Edit: Based on some answers, I want to clarify that I do not want one shortcut per profile. No matter how many profiles I have, I want exactly two shortcuts: one that always opens the default profile, and one that allows me to interactively choose from all profiles, but does not change what profile is marked as default.

6 Answers 6

1

The only way to achieve your goal would be to write-protect your profiles.ini file after the initial setup. This way Firefox wouldn't be able to update the file leaving everything as you set it up.

  1. Set up your profiles.
  2. Select your default profile by selecting a profile in the profile manager and checking "Don't ask at startup".
  3. Mark your profiles.ini as read only.

From now on, starting Firefox without -p or -p "profile name" or -p "profile path" will always start your default profile. Opening a profile via the profile manager or the -p switch can't change your profiles.ini.

Obviously, you'd have to make your file writeable again to change things or create new profiles. Other than that you should be fine.

1

You can do this by installing Firefox portable (http://portableapps.com), and install it to hard drive in a NEW location rather than a USB drive. Here is how I would do it (although you can tweak this to achieve want you want), leave your standard installation where it is. Clone the portable folder to second location. Copy your first profile data to portable folder "DATA" sub-folder as described on their website and copy your second profile to the the second new portable "DATA" sub-folder (the folder below the one containing FirefoxPortable.EXE). Start each FirefoxPortable.EXE and check it is customized correctly (eg. addons, plugins in the normal way etc). Optionally rename FirefoxPortable.EXE to FFP.EXE if you like short names :-) and setup two shortcuts to each of these portable installation folder's FFP.EXE. I have used V6.0 and V25.0.1 this way and worked fine.

Advantages

  • You an run completely separate configs (they can even be different versions of Firefox if you desire). Yes it takes up more disk space as you clone firefox application but I find this easier to manage.
  • I run about 30 addons and have had no issue with the portable version
  • If you have a collection of active and inactive addons troubleshooting addon confilcts is easier. Just take a clone of the folder and use it for testing just a single addon switched on without messing up you main profile.

Issues (applies if Firefox is default browser)

  • Leave you standard installation as is and set as default browser
  • Leave your old standard installation with the profile manager prompt as the default. (In your case you could run this as your "general" profile with no prompting". Occasionally some application will try to launch this default browser when you are not expecting it (e.g. eg a chat client that opens URLs) and whenever you see the profile prompt just exit and start the correct portable version via shortcut
  • Well now there are 3 versions for Firefox - which should it use for files? The solution is always start the Firefox from the shortcuts before opening *.url, *.htm[l], or *.mht and they will open in the active Firefox correctly.
  • If you use firefox sync I would expect that you name each profile as a different "device name" for it to play nicely. For example syncing your bookmarks across all profiles.
  • I do software updates manually I would recommend that.
1
  • This is still more cumbersome than I'd like, because it requires me to install multiple Firefoxes and then distinguish separate icons for them. As I said in the post, what I'd like is a way to have just two icons: one for "open the default profile" and one for "let me choose which profile to open this time only without changing the default profile".
    – BrenBarn
    May 26, 2014 at 18:24
1

I don’t know what your operating system is, but if your are on an Unix one, I may have a script that does exactly what you want (which was exactly the behavior I needed too, if I understood you correctly).

The idea is to use the script to launch your “Other” firefox. The script determines the default profile by looking at the profiles.ini file, then it launches the new firefox instance with profiles manager, and eventually restores the default profile configuration as soon as it is changed. A bit hacky, but I’m using it and it works fine.

If on Windows, you may be able to reproduce an equivalent script, but I can’t help you on this matter.

Here is the script, to save in a firefox-other.sh file, and to launch with ./firefox-other.sh in a terminal, or with a .desktop file. You may have to adapt the configuration at the beginning:

#!/bin/bash

# configuration
profiles=/home/jerome/.mozilla/firefox/profiles.ini
firefox=`which firefox`

# find current default profile
profile_regex="\[([^\[]+)\]"
name_regex="Name=([^$]+)"
default_regex="^Default=1"
while read line
do
    [[ $line =~ $name_regex ]]
    if [[ -n "${BASH_REMATCH[1]}" ]]
    then
        profile_name="${BASH_REMATCH[1]}"
    fi
    [[ $line =~ $profile_regex ]]
    if [[ -n "${BASH_REMATCH[1]}" ]]
    then
        default_profile="${BASH_REMATCH[1]}"
    fi
    [[ $line =~ $default_regex ]]
    if [ -n "${BASH_REMATCH[0]}" ]
    then
        break
    fi
done < $profiles

echo "Default profile is \"$profile_name\" [$default_profile]"
last_update=`stat -c %Y $profiles`

# restore default profile
function restore {
    on_default=0
    tmp="${profiles}.new"
    rm -f $tmp
    while read line
    do
        [[ $line =~ $profile_regex ]]
        if [[ "${BASH_REMATCH[1]}" = $default_profile ]]
        then
            on_default=1
        fi
        if [[ "$line$on_default" = 1 ]]
        then
            echo "Default=1" >> $tmp
            on_default=0
        fi

        # echo existing line unless it is the default declaration
        [[ $line =~ $default_regex ]]
        if [ -z "${BASH_REMATCH[0]}" ]
        then
            echo $line >> $tmp
        fi
    done < $profiles

    mv $tmp $profiles
    echo "Default profile restored to \"$profile_name\" [$default_profile]"
}

# start firefox with profile manager
echo -n "Start Firefox..."
$firefox -no-remote -P 2> /dev/null 1> /dev/null &
pid=$!
echo -e "\rFirefox started with pid $pid"

# loop until $profiles is changed or firefox instance killed
while true
do
    sleep 1

    # watch profiles
    update=`stat -c %Y $profiles`
    if [ $update -gt $last_update ]
    then
        # profiles updated
        break
    fi

    # watch instance
    if [ -n "`kill -0 $pid 2>&1`" ]
    then
        # instance terminate
        break
    fi

done

# then restore
restore
-1

Delete your profiles and start afresh. This will re-create the default profile. You do not have to give this a name. When other programs open a web page in Firefox, it will use this profile. For you special needs, create new profiles and launch them using the profile manager switch as required.

1
  • This doesn't work. It recreated a default profile, but it still has the same problem I'm asking about in the post: when I choose a different (non-default) profile from the profile manager, it either sets that profile as default or sets no default profile.
    – BrenBarn
    Nov 13, 2012 at 0:14
-1

I will use two profile names for this. "General" is your normal-use profile. "Other" is that JavaScript hacky one. Make sure you use YOUR profile names when following this.

  1. Open profile manager and make sure that "General" is set to the default profile.
  2. Make a copy of your Firefox shortcuts. (So now you have TWO identical Firefox shortcuts).
  3. Rename ONE of the shortcuts to "General", go to right-click -> Properties, and add the following string to the end of the Target:
    -P "General"
  4. Press OK.
  5. Rename the other shortcut to "Other", go to right-click -> Properties, and add the following string to the end of the Target:
    -P "Other" -no-remote
  6. Press OK.

Now you are done. You have two different shortcuts for each profile. Your default profile will be "General" so programs will open shortcuts in that profile. Now for the major advantage: you can use both profiles at the same time! They will open in different instances and windows.

3
  • Yes, I know I can do this. But I don't want to create separate shortcuts for each profile. As I said in the question, I want to be able to select a profile from the Firefox profile manager, without having it marked as the default.
    – BrenBarn
    Nov 12, 2012 at 20:56
  • Huh, I never guessed anyone would want to go through the profile manager. Have you thought about an add-on solution to switching profiles? Nov 12, 2012 at 21:08
  • I guess I could, but add-ons themselves are local to a particular profile, so this wouldn't really solve my problem overall.
    – BrenBarn
    Nov 13, 2012 at 20:39
-1

Similar to what JC2k8 suggested you could alter profiles.ini. My solution is for each shortcut to call a front end batch script.

Shortcut1 - runs batch script that copies file profiles.001, the "general" profile, profilemanger is not enabled.

Shortcut2 - runs batch script that copies file profiles.002 to profiles.ini, which is your setup to prompt WITH profilemanager and launch Firefox asynchronously after waiting lets say 10 secs then copy the "general" profiles.001 back to profile.ini so "general" profile setup is left in place while your running with firefox.exe via using profiles.001 info. As far as I know profiles.ini is used only to initialize Firefox so should be ok changing it when main firefox window has initialized.

2
  • As I have commented on other answers, I don't want one shortcut per profile. I want two shortcuts, one for the default profile and one that lets me interactively choose among all other profiles.
    – BrenBarn
    May 27, 2014 at 17:45
  • ok I have reworded to clarify what I meant. I think that would do what you want. Your "general" profile is always set as default. Shortcut2 is the only time you see Profile manager.
    – Scott R
    Jun 7, 2014 at 5:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .