Tip

Re-branding Mozilla

The Web browsers made by the Mozilla Foundation are highly customizable, either on Linux, Unix or Windows. In this tip I'll show you how to change the animated waiting for download icon, officially known as a throbber. It's the icon in the top right corner of either the Firefox browser or the Mozilla Application Suite browser.

All Mozilla technology has the same core technology, and that includes a chrome directory in the install area. Chrome is a set of human-readable, plain text, interpreted files that are used to specify the user interface of the application. Most differences between Mozilla's Firefox browser and the Application Suite's browser are differences in chrome. Think of the chrome as Mozilla's variation on Perl's CPAN archive, PHP's PEAR archive, or Java's JAR system.

If your Mozilla is installed in /local/mozilla, then the chrome directory is in /local/mozilla/chrome. In the case of Firefox, there's a file in there called "classic.jar." This is the look and feel for the Firefox browser when viewed with the standard Firefox theme. There's an equivalent file called "modern.jar," which aims to support the modern theme, but stick with classic.jar for now. The classic.jar file is in ZIP format, so its contents can be viewed with a tool like "unzip" (try the -l option to avoid expanding the file in-place) or the more graphical "file-roller." Work on a copy of the file, not the original.

To change the throbber,

    Requires Free Membership to View

just note that this JAR file contains files named Throbber.gif and Throbber-small.gif (beware that these names might change for the final Firefox release). These are animated GIF files, just like the ones you might create for the Web with a tool like JDraw or the GIMP. The equivalent .png files are the static, non-animated versions. They're used when nothing is being downloaded. All you have to do to change the throbber icon is replace these .gif files in the JAR file with new ones of your own design, put the file back, and restart the browser.

In the case of the Mozilla Application Suite, the throbber files are still in classic.jar, but they're called throbber-anim.gif and throbber16-anim.gif. Otherwise it's all the same.

If you want to go further, then you can. For example, Firefox raises an "About Firefox" dialog box if the "About" option is chosen from the Help menu. You can change the content of this dialog as well. In the Firefox chrome directory, there's a file called browser.jar. Unzip a copy of that, and you'll be able to see the aboutDialog.xul file. That file's content is written in Mozilla's XUL language, and specifies the whole of the dialog box. Just modify it (carefully) and put it back. There's plenty of information about XUL on the Web and in books.

In fact, Mozilla applications are highly customizable in this way. This is exactly how different themes are developed for browsers, and it is how different browsers are developed. Once you open the chrome, the world of custom GUI design is yours to enjoy.


Nigel McFarlane is an open source software analyst and technologist with a broad background in technology and software engineering. He has an extensive programming background and degrees in computer science and physics. His latest book is Rapid Application Development with Mozilla from Prentice Hall PTR.

This was first published in October 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.