How to integrate the latest Firefox in Gnome 3 on Debian Jessie

Debian Jessie and Firefox and Gnome may sound like an odd threesome, but Jessie can run Firefox as a native Gnome 3 application. And why would you want to do that? Debian already comes with a perfectly good web browser --- Iceweasel, a rebranded version of Firefox. Why? Because of updates. Firefox updates much more often than Iceweasel. If you want the latest features and the latest bug fixes and security updates, you want Firefox.

Firefox Installation

First download Firefox from the Mozilla site.

Be sure you have the proper version (32 or 64 bit) for the computer you will be installing it on.

We will now install Firefox in /opt. (Where Optional packages go.)

sudo mv Downloads/firefox*bz2 /opt
cd /opt
sudo tar -xvjf firefox*bz2

You will now have a directory called 'firefox'. Close Iceweasel and start Firefox by hand:

firefox/firefox

(You may see an odd message about GLib, but you can ignore it.)

Ok? Good! If not, have a look at the Firefox Help site.

While we are here, check where Firefox keeps its main icon:

find firefox |grep mozicon

It's probably

firefox/browser/icons/mozicon128.png

Integrating Firefox in the Gnome Desktop

For Gnome to see Firefox, it must have a firefox.desktop file in /usr/share/applications. We will make use of the fact that Iceweasel is basically Firefox wearing a funny hat. The iceweasel.desktop file will serve as our template.

cd /usr/share/applications
sudo cp iceweasel.desktop firefox.desktop

Edit firefox.desktop, changing 'Iceweasel' to 'Firefox'. Well, maybe not all of them. You may want to first strip out the languages that don't apply to you. Suddenly the file gets much smaller!

[Desktop Entry]
Encoding=UTF-8
Name=Iceweasel
Comment=Browse the World Wide Web
GenericName=Web Browser
X-GNOME-FullName=Iceweasel Web Browser
Exec=iceweasel %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=iceweasel
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=Iceweasel
StartupNotify=true

These are the two lines we are most interested in:

Exec=iceweasel %u
Icon=iceweasel

Change them to

Exec=/opt/firefox/firefox %u
Icon=/opt/firefox/browser/icons/mozicon128.png

Reboot your computer so that Gnome will be aware of the changes. You should now be able to find Firefox in the search box, add it to the dork and run it like a normal Gnome application. And you can still run Iceweasel if you like. (Just not both at once.)

Install Firefox updates

Check the menu 'Help | About Firefox'. When there is an update, it will say 'Updates available'. Close Firefox and restart it by hand with root privileges:

sudo /opt/firefox/firefox

The new version will download. After it finishes, click 'Restart Firefox to Update'. Check the menu 'Help | About Firefox' and you will be assured that Firefox is up to date. Close this instance of Firefox and use it normally until the next update. Your web browser is a favorite target for criminals. You are much safer when only Root can make changes to Firefox.

And now...

Now that you know about desktop files... What other applications would you like to make Gnome-aware?

Share this page:

2 Comment(s)