O'Reilly logo

Firefox Hacks by Nigel McFarlane

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #79. Make Firefox Match the Desktop

Take away Firefox's distinctive look, so that it appears to be just another desktop soldier.

This hack shows how to make Firefox inherit the appearance dictated by the desktop environment, whether that be Windows, Mac OS X, GNOME, or (sometime soon) KDesktop. Instead of looking like itself, Firefox can be made to look like everything else. Fundamentally, that means styling XUL content so that it looks right. There are also issues with portability [Hack #91] .

There are several ways to provide desktop uniformity. The ultimate solution is to use the -moz-appearance style property, but let's dispose of the simpler alternatives first.

Building Static Skins

The simple way to make Firefox look like the desktop is to build a theme that looks exactly like the desktop. Themes are made up of skins , with one skin per package. The easiest way to build such a theme is to start with an existing, quality theme such as the default theme, or a popular and well-maintained theme from the Mozilla Update site (http://update.mozilla.org). Then:

  1. Identify the JAR file that holds all the original theme's skins.

  2. Replace files one at a time in the skins.

  3. Restart the browser after each change to see what effect has resulted.

Static themes generally affect XUL content the most. Particularly for Firefox, a large portion of the main window is given over to HTML page display, and that display is resistant to theme changes. This is because a subset of the files in the res folder ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required