3

I use GNOME on Debian Jessie and I have different Firefox installations:

  • the ESR version bundled with GNOME, which I cannot remove (as it is a dependency)
  • the stable version installed from the special Debian repo
  • the binary files from Mozilla (installed in /opt/firefox/...) downloaded from their website as explained here
  • the developer edition (also as binary files) from Mozilla (installed in /opt/firefox-dev-edition)

In /usr/share/applications there are therefore different .desktop files.

$ ls -la firefox*
-rw-r--r-- 1 root root 3640 Okt  4 21:29 firefox-bin.desktop
-rw-r--r-- 1 root root 3,6K Okt  2 08:06 firefox.desktop
-rw-r--r-- 1 root root 2,2K Aug 31 22:57 firefox-dev.desktop
-rw-r--r-- 1 root root 3,8K Sep 22 08:29 firefox-esr.desktop

So all files have basically this layout:

[Desktop Entry]
Encoding=UTF-8
Name=Firefox
Name[bg]=Firefox
Name[ca]=Firefox
[...some more languages...]
Comment=Browse the World Wide Web
Comment[bg]=Сърфиране в Мрежата
Comment[ca]=Navegueu per el web
[...some more languages...]
X-GNOME-FullName=Firefox Web Browser
X-GNOME-FullName[bg]=Интернет браузър (Firefox)
X-GNOME-FullName[ca]=Navegador web Firefox
[...some more languages...]
Exec=<somePath> %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=<someIcon>
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;[...]
StartupWMClass=<someStartupClass>
StartupNotify=true

So the ESR version has the Name=Firefox ESR and of course also X-GNOME-FullName=Firefox ESR Web Browser. The things that matter are these:

Exec=firefox-esr %u
Icon=firefox-esr
StartupWMClass=Firefox

I used this file (and the icon files provided by Mozilla) to create a desktop file for the developer edition, which looks like this:

Exec=/opt/firefox-dev-edition/firefox %u
Icon=firefoxdev
StartupWMClass=FirefoxDev

The firefox.desktop is created by the installation from mozilla.debian.net and is this:

Exec=/usr/lib/firefox/firefox %u
Icon=firefox
StartupWMClass=Firefox

To create a shortcut for the binary version of Firefox I copied firefox.desktop and named it firefox-bin.desktop. I changed the NAME= and X-GNOME-FullName= of the original firefox.desktop to distinguish it from the binary version and changed firefox-bin.desktop to this one:

Exec=/opt/firefox/firefox %u
Icon=firefox
StartupWMClass=FirefoxBin

Also in /usr/bin there are different binaries:

$ ls -la firefox*
-rwxr-xr-x 1 root root 113 Sep 22 08:29 firefox
lrwxrwxrwx 1 root root  30 Sep 22 08:40 firefox-esr -> ../lib/firefox-esr/firefox-esr
lrwxrwxrwx 1 root root  22 Okt  2 08:17 firefox.real -> ../lib/firefox/firefox

So the issue is that GNOME still confuses these Firefox installations. All version are sometimes labelled as "Firefox ESR" in the top panel when I am running them. So when I click on "Firefox" to open it for a short time in the top panel "Firefox" is shown, but a few seconds later it changes to "Firefox ESR" although I can confirm that the executed Firefox installation is not the ESR version.

Firefox starts as "Firefox", name later changes to "Firefox ESR"

This happens with Firefox, "Firefox Debian" and Firefox Developer Edition. Sometimes even Tor Browser gets the label "Firefox ESR", which indicates that GNOME possibly just uses the executable name (firefox in this case) to determinate what program is running...

So how can I fix this?

Edit: For testing I created a symbolic link from /opt/firefox/firefox -> /opt/firefox/firefoxbin.real and used that "new" file in the desktop file, but this changed nothing, so the executable name does not seem to matter.

Edit2: Additionally I now changed the StartupWMClass of firefox-esr.desktop from Firefox (which was duplicate in firefox.desktop) to FirefoxESR. Afterwards now GNOME always shows me "Firefox Debian" (the name saved in firefox.desktop) even for all other Firefox versions, even for the ESR one. Changing the StartupWMClass for firefox.desktop did not help.

  • " I changed the NAME= and X-GNOME-FullName=..." have you also changed Name[de]= (or whatever your locale is) ? – don_crissti Oct 4 '16 at 19:57
  • @don_crissti Now, yes. And I see that the app overview works now, but the top bar still shows the wrong name. I edited the question. – rugk Oct 4 '16 at 20:37
  • So I added a gif showing the issue and I also explained that this issue also happens with the dev edition. – rugk Oct 4 '16 at 22:09
  • You may want to specify the --class parameter in firefox. Take a look at my similar issue: unix.stackexchange.com/questions/313151/… – AkiRoss Oct 6 '16 at 20:32
4

Well, I might as well answer to your question.

Try using the --class flag in firefox. If it matches the relative .desktop file, the various instances should be grouped correctly. For example, in your .desktop file:

Exec=firefox --class FirefoxDevel %u

It works for me for the same firefox executable, so as long as your versions support that flag, you should be good to go.

  • "as long as your versions support that flag" - Do you have any information what versions support this flag? – rugk Oct 7 '16 at 14:15
  • So actually your tip worked. I just got it much better when passing the StartupWMClass to firefox with this parameter instead of the "relative .desktop file". Afterwards this works flawless! – rugk Oct 7 '16 at 15:53
  • 1
    rugk, I think it is supported for every recent version (FFox > 3 or 4), so it should be ubiquitous :) Glad to see it was helpful, cheers! – AkiRoss Oct 7 '16 at 17:08
  • However there is still one issue: When I restart Firefox from inside Firefox (e.g. when restarting after an update or add-on installation) the --class parameter gets missing (of course) and therefore the newly started instance of Firefox is again confused by GNOME... So would you think this is a Firefox bug/issue? – rugk Oct 7 '16 at 22:55
  • 1
    Personally I think it's a firefox issue: it should keep the same configuration and parameters if restarted, so the --class should be the same. – AkiRoss Oct 8 '16 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.