Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Learn More

Open a URL in a specific firefox profile window

  • 7 respostas
  • 1 tem este problema
  • 1 visualização
  • Última resposta por Ancoron

more options

I am running Firefox on Ubuntu 15.04 64bit and using the KDE 5 framework and KWin.

Previously, using KDE 4 I was heavily using virtual desktops for completely different tasks. As things changed with KDE 5, I am forced to use what they call Activities.

I also almost solved the problem of Firefox not playing nice with KDE in general and in specific to the Activities by using a different profile for each Activity.

The actual problem:

Each time I click a link inside some application inside a KDE Activity, the following message window pops up: "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."

Of course, when there is no Firefox instance running yet with the desired profile, any link opens up as expected with a new instance, just not a second or third or ... (which makes me copy'n'paste, which in turn makes me loose precious time and is just annoying).

So, I don't know how the internal communication of Firefox works but I only start Firefox with the options "--new-instance" to avoid getting a new window of the very first instance and "-P" for the profile.

UPDATE Although the "solution" found was to make use of the -remote "openURL(<url>)" command line argument, that argument is being deprecated and will be removed very soon (if it isn't removed already), see details here: https://bugzilla.mozilla.org/show_bug.cgi?id=1080319

I am running Firefox on Ubuntu 15.04 64bit and using the KDE 5 framework and KWin. Previously, using KDE 4 I was heavily using virtual desktops for completely different tasks. As things changed with KDE 5, I am forced to use what they call Activities. I also almost solved the problem of Firefox not playing nice with KDE in general and in specific to the Activities by using a different profile for each Activity. The actual problem: Each time I click a link inside some application inside a KDE Activity, the following message window pops up: "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." Of course, when there is no Firefox instance running yet with the desired profile, any link opens up as expected with a new instance, just not a second or third or ... (which makes me copy'n'paste, which in turn makes me loose precious time and is just annoying). So, I don't know how the internal communication of Firefox works but I only start Firefox with the options "--new-instance" to avoid getting a new window of the very first instance and "-P" for the profile. '''UPDATE''' Although the "solution" found was to make use of the '''-remote "openURL(<url>)"''' command line argument, that argument is being deprecated and will be removed very soon (if it isn't removed already), see details here: https://bugzilla.mozilla.org/show_bug.cgi?id=1080319

Modificado por Ancoron a

Todas as respostas (7)

more options

I understand that when clicking inside another application that the warning comes up that there is already another instance of Firefox open.

Other ways that might correct the issue:

How to set Firefox as the defualt browser, the last bit in the KDE section may have -new-instance in it where %u is?

more options

First of all, thank you for responding.

guigs2 said

I understand that when clicking inside another application that the warning comes up that there is already another instance of Firefox open.

I can "understand" this as well to some extend (mainly for cache/configuration consistency reasons). However, what I do not understand is why the explicit profile parameter is ignored when invoking the firefox command without "--new-instance". It behaves as if the very first instance (whichever profile it is) creates a local socket and then a command like "firefox -P second-profile '<url>'" or "firefox -P third-profile '<url>'" will just open a new tab in the process started with the command "firefox --new-instance -P first-profile". Annoyingly, this also makes KDE switch to the Activity where the Firefox instance using "first-profile" is actually running.

So, all I need would be that a command like firefox -P <profile> <url> attached to the instance running the specified profile and opens the given URL in a new tab or window. If that would work, I would be happy! :-)

guigs2 said

Other ways that might correct the issue:

The "fixed" version of the firefox.desktop file is already in place with Ubuntu 15.04 by default.

guigs2 said

How to set Firefox as the defualt browser, the last bit in the KDE section may have -new-instance in it where %u is?

Is that a question or suggestion?

I am actually using a custom script that detects the currently displayed KDE Activity and builds a firefox command line that is being executed.

Currently, due to the fact that explicit profile arguments are ignored except for the very first instance, I have to use firefox --new-instance -P <profile> <url> instead of firefox -P <profile> <url>.

more options

There are two other commands:

I am sorry I do not know enough about these to suggest a solution, I was only trying to find points of customization.

more options

Thanx for your effort but I already tried also the profile-path variant with the same results.

more options

You can open a new instance or a new profile, but you can't direct a command to a specific profile AFAIK. I don't know if using -remote would make this possible.

  • bug 716110 - split -new-instance flag out of existing -no-remote flag
  • Bug bug 855899 - -new-instance flag does not work
more options

cor-el said

I don't know if using -remote would make this possible.

You made my day! Indeed, a firefox -P <profile> -remote "<cmd>" works like a charm.

So, this is documented in the official command line options, but at least not in the Ubuntu version I use, neither using --help or the man page, otherwise, I could have found this trick earlier myself.

Thank you again for pointing me to this! :-)

more options

While the -remote works fine from the console, it looks like it does not work from within applications and produces the following error message:

Error: Failed to send command: 500 command not parseable

As it turned out, there is an old bug, which still applies here: https://bugzilla.mozilla.org/show_bug.cgi?id=478951

So, I just made sure that my (proxy) script empties that variable before invoking the real firefox.