View the latest version of this file online: http://mozile.mozdev.org/docs/mozileDevelopment.html

Welcome to Mozile, the WYSIWYG XHTML editor for Mozilla! This document describes the various tricks used to develop Mozile.

Contents

  1. Mozile Documentation
  2. Mozile Development
    1. Mozile Packages
    2. Mozile XPI
    3. Mozile JAR
    4. Mozile CVS
    5. Mozile Debugging
  3. Mozile Content
  4. Mozile Locale
  5. Mozile Skin

Mozile Development

Mozile Packages

The changes to the extension management system in Firefox 0.9 mean that only the Stable version of Mozile is currently available for Firefox 0.9 and higher.

Mozile has two different levels of development, and is packaged in two different ways. The first level is the stable branch, and the second is the development branch. We hope that the stable branch has very few bugs, while the development branch is the place for additional features to be added and tested.

The stable version is packaged neatly into a JAR archive, and installed into either the browser's chrome directory, or the chrome directory of the user's profile. The decision as to where Mozile is installed is made by the user during installation. The development version of Mozile is not packaged into a JAR archive, it is just a normal directory full of files. The develpment version is installed in the same location as the stable version (the browser or user chrome directory).

Only one of these version can be used at a time, and which one is used will depend upon the chrome.rdf file stored in the appropriate chrome directory.

Mozile XPI

XPI stands for Cross-Platform Installer, and XPI files are used to install Mozilla and Firefox extensions. An XPI file is simply a ZIP file which includes installation instructions. The instructions are written in the JavScript file install.js, which Mozilla looks for when asked to install. More details can be found in Chapter 6 of Creating Applications with Mozilla.

Mozile JAR

The changes to the extension management system in Firefox 0.9 mean that only the Stable version of Mozile is currently available for Firefox 0.9 and higher. The methods described below for converting an installation do not apply to Firefox 0.9 and higher.

For the stable version of Mozila is packaged in a JAR archive inside the XPI file. A JAR archive is just another kind of ZIP file, with a few additions like a manifest. The XPI install process for the stable version will place the mozile.jar file (containing all of Mozile's files) into the appropriate chrome directory.

If you want to make changes to the stable version of Mozile installed on your system, you will have to unpack the JAR archive, make your changes, then package it again, and replace the old mozile.jar file. The mozileBuild script can help with this; it's available in Mozile CVS here http://www.mozdev.org/source/browse/mozile/source/extension/package/mozileBuild. The alternative is to unpack Mozile into a sub-directory of the chrome directory, like the development version does by default. This will save you the tedious steps of unpacking and repacking the JAR archive, but it requires a few modifications to the chrome registry.

The chrome.rdf file is what tells Mozilla where to find the files for all the installed extensions. There are copies of the chrome.rdf file in each chrome directory, but we are only interested in the one which is associated with the Mozile installation. This will be in the user's chrome directory, if Mozile was installed for a specific user, and in the browser's chrome directory is Mozile was installed for all users at once.

Here are the steps needed to convert a JAR installation into a directory installation:

To convert a directory installation into a JAR installation, just package the "mozile" directory into a "mozile.jar" file, and perform the replacements on those three lines in reverse.

Mozile CVS

The Mozile CVS can be accessed on the web (using CVSWeb) at http://www.mozdev.org/source/browse/mozile/. It can also be accessed using a CVS client, following the instructions here: http://www.mozdev.org/docs/start.html#content2. Here is a quick summary of anonymous CVS access. Login as guest (password is guest) using the following command:

cvs -d :pserver:guest@mozdev.org:/cvs login

Then check out a copy of Mozile using:

cvs -d :pserver:guest@mozdev.org:/cvs co mozile

Mozile currently has two CVS branches, one called MAIN and one called DEVEL. These are for the stable and development versions respectively. To check out a copy of the DEVEL source, use one of the following commands:

cvs -d :pserver:guest@mozdev.org:/cvs co -r DEVEL mozile

Or:

cvs -d :pserver:guest@mozdev.org:/cvs update -r DEVEL mozile

Mozile Debugging

Debugging any Mozilla extension is a tricky thing. In order for changes to take effect the browser will have to be restarted, so that the chrome files can be reloaded. This can be tedious.

Another problem is that errors in chrome JavaScript are not as well reported as in normal pages. Mozile has recently implemented it's own debugging system, however, which should make things easier. By default it is turned off, but by changing "Settings -> Debugging Level" to "Minimal Debugging" or "Full Debugging" the given degree of debugging will be enabled.

Most debugging messages appear in the Status bar of the current window. You can click on the Bug button in the Mozile toolbar to show a complete list of debugging messages.

If there is a function that you want to debug inside Mozile, then it is best to add a call to the mozileDebug() function.

James A. Overton - http://mozile.mozdev.org - 2004-04-16