Mozile Development : 0.6 Series for Firefox 1.5

Page Contents

  1. Mozile Packages
  2. Mozile XPI
  3. Mozile For Firefox
  4. Mozile For Mozilla
  5. Mozile CVS
  6. Mozile Debugging
  7. Mozile Testing

Mozile Packages

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 installation files for the stable version are named "mozile-[Version].xpi" while the installation files for the development version are named "mozile-[Version]-devel.xpi".

The stable version is packaged neatly into a JAR archive. The development version of Mozile is not packaged into a JAR archive, it is just a normal directory full of files. Only one of these versions can be installed and used at any one time.

Mozile XPI

XPI stands for Cross-Platform Installer (pronounced "zippy"), and XPI files are used to install Mozilla and Firefox extensions. An XPI file is simply a ZIP file which includes installation instructions.

For the Mozilla browser (not Firefox) 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.

For more information on developing and debugging extensions with Firefox, see this page:
http://developer.mozilla.org/en/docs/Extensions.

Mozile For Firefox 1.5

Extensions are installed in a directory called "extensions" in the user's profile, and each one is kept in its own subdirectory. The individual subdirectories are labelled with the extension's unique identifying code or name.

Mozile's name is : {mozile@mozile.mozdev.org}

Inside the extensions directory is a file called "Extensions.rdf" that contains information on each of the installed extensions. Inside Mozile's directory are files named "install.rdf" and "chrome.manifest" which contain all of the information about the extension, and a directory called "chrome" which contains all of the files used by Mozile.

If you have installed the stable version of Mozile the "chrome" directory will contain a single file called "mozile.jar". A JAR file is just another kind of ZIP file, and this one compresses all of the Mozile files. 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:
www.mozdev.org/source/browse/mozile/source/extension/package/mozileBuild

If you are using the development version the "chrome" directory will contain subdirectories called "content", "locale", and "skin". All of Mozile's files are contained in these directories. You can edit these files, and after Firefox restarts you will see the changes to Mozile.

To switch between the stable and development versions of Mozile, simply uninstall your current version using the "Tools" » "Extensions" dialog, restart Firefox, and then install the new version. Updating from an old stable to a new stable version (or an old development version to a new one) will not require you to uninstall Mozile first.

Mozile For Mozilla

A separate build will be required if you wish to use this version of Mozile with Mozilla. The main changes required are to the installation procedure. Refer to previous builds of Mozile for Mozilla to see how this is accomplished.

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

The source files for the 0.6 Series can be found in the following directory:
mozile\source\extension\mozile-0.6\

Note that the DEVEL branch of the tree is no longer being used.

Mozile Debugging

Debugging any 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.

Javascript : strict

Another problem is that errors in chrome JavaScript are not as well reported as in normal pages. It is recommended to switch on the strict Javascript error reporting preference to help with correcting faulty code. Type "about:config" into the browser address bar to show all the preferences. In the Filter type "javascript" to show all the Javascript preferences. Set "javascript.options.strict" to "true" if it currently set to "false". Normal Mozile code is written to the strict standards and should not produce any errors or warnings. If you see any, please report them as a bug.

mozileDebug()

Mozile has it's own inbuilt debugging system. 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. Important 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, or you wish to set an "Alert" trap when a piece of code is executed, then it is best to add a call to the mozileDebug() function.

Venkman Debugger

Venkman, the JavaScript debugger, can be a lot of help once you learn how to use it. So can the DOM Inspector, which is built in to both Mozilla and Firefox. (You may need to do a Google search to find a Venkman version that will work with Firefox 1.5)

Mozile Testing

JsUnit

We are developing an automated test suite for Mozile and eDOM. We use JsUnit to put Mozile through its paces. If you have the developer's version of the Mozile XPI installed then you can go to the testing directory for details of how to install JsUnit and run the tests. [Note: MozileTesting.xml has not been updated for Firefox 1.5 and you may need to open it directly from your local disk, not the extension help menu.]

The test units have not been updated for a while and may not work.

JSDoc

Parts of the code are documented for use with JSDoc. In particular, it helps to run the eDOM files through JSDoc to produce a reference of all the properties and methods. At some point, the JSDoc output will be added to the developer docs. Further info can be found at the JSDoc homepage:
http://jsdoc.sourceforge.net/