Comment 14 for bug 711305

Revision history for this message
In , Brianvanderburg (brianvanderburg) wrote :

I'm running Debian Jessie and I seem to have the problem as well.

First, I have two main Firefox profiles, "default" and "empty". Empty has few extensions while default is my fully loaded profile. In order to be able to easily run them, I create custom .desktop files that execute "firefox -P <default|empty> -new-instance %U" If I don't use the "-new-instance" (or "-no-remote"), and I decided I want to run the empty profile but the default is already running or vice versa, I get the "already running error".

It seems, when I create a shell script to execute "xterm" and set it as the mail application in Firefox, I get a bunch of MOZ_ environment variables. I played around with un-setting the variables before running Thunderbird. It just so happens that, at least for me, if I unset a variable "MOZ_NEW_INSTANCE" then it seems to work. To verify I start Thunderbird and then open a terminal without any MOZ_VARIABLES and execute "thunderbird mailto:<email address hidden>". Everything works. If I then execute "MOZ_NEW_INSTANCE=1 thunderbird mailto:<email address hidden>" I get the "already running" error.

So it seems that what is happening, at least for me, is when I run Firefox with -new-instance, it sets an environment variable that is in turn passed to child processes. When I click on an email link it launches Thunderbird, but that environment variable is set and Thunderbird tries to start a new instance. The same seems to happen if I use -no-remote instead, it just sets a variable MOZ_NO_REMOTE=1

I create the following script and set it as the mail handler for the time being.

    #!/bin/sh
    env -u MOZ_NEW_INSTANCE -u MOZ_NO_REMOTE thunderbird "$@"

Currently there is no way around "-no-remote" or "-new-instance" with Firefox it seems. If I launch one profile, and wish to launch another profile, then it will complain unless I use one or the other. Ideally, there should be a way to launch multiple profiles, but to have "remote" features with both, either designating one as the default to receive remote commands or a chooser to list available instances to receive remote commands. For now, the shell script to remove the environment variables seems to help.