News Stay informed about the latest enterprise technology news and product updates.

Enterprise Mozilla: Try these handy Mozilla tools

There's more to Mozilla than meets the eye. In this article, expert Nigel McFarlane drills into the Mozilla Application Suite and comes up with some great tools for enterprise IT shops.

We're so used to the big-buttons user interface of Mozilla that driving the Mozilla browser or the platform by any other means seems odd, at least. The trouble is that those big buttons don't offer much flexibility. With this quick guide to Mozilla tools, you'll discover how to get more out of Mozilla Application Suite on enterprise Linux.

The Mozilla Application Suite includes the releases of Mozilla that contain the browser, e-mail, composer and other apps. The latest release is 1.6. You can find the same functionality in the standalone browser and e-mailer, except the menu options and file names are slightly different. Every Mozilla application contains the Mozilla platform.

First, you can drive the platform from the command line. To stop the platform from displaying the browser (the default), use the "-chrome" option (try "mozilla -help", one minus only). That means using this syntax:

mozilla -chrome URL

It does not include:

mozilla URL

The URL part can be modified. Mozilla supports the "resource:" and the "chrome:" URL schemes as well as "http:", "ftp:", "file:" and "email:".

The "resource:" scheme is like "file:", except it is relative to the top of the Mozilla install area; that's usually the same as "$MOZILLA_FIVE_HOME" or "dirname 'type mozilla'". The "chrome:" scheme usually maps to the "resource:/chrome" directory, but it really describes a specific application that has been registered with the platform. So "mozilla -chrome chrome://navigator/content/navigator.xul" is the same as plain "mozilla".

Recall that "Navigator" is the old name for the Netscape browser. You can also strip the browser away from plain HTML:

mozilla -chrome file:///tmp/test.html

Try these all out. Every window that can be displayed from the standard set of menus can also be displayed from the command line using "some chrome: URL". As a final eye-stretching test, try:

mozilla chrome://navigator/content/navigator.xul

Note that the "-chrome" option is missing, so this command displays the browser window inside, well, another browser window. Examine the weird window that results: Both nested browsers still work.

Mozilla also supports .jar files. These are in pkzip format, which can be read with the Unix tools unzip/zip (not gunzip/gzip). The chrome area is full of .jar files, because they're a convenient and space-saving way to package a Mozilla application. Be aware that the order of files in such .jar archives is sometimes important and shouldn't be changed. There's no Java at work here, by the way. Mozilla supports the "jar:" scheme for viewing files in .jar archives, but you can't use that from the command line for security reasons. It's easier to copy those files to /tmp and unpack them yourself with unzip. Use any text editor to view all files that aren't images.

Finally, the DOM Inspector and JavaScript Debugger are two powerful diagnostic tools that work equally well with Web pages and with Mozilla applications. Both are bundled with the standard Mozilla Application Suite.

The DOM Inspector lays open the content and layout of an XML document. From the Inspector, choose "File|Inspect a window" and pick any Mozilla window currently open. Down on the left-hand side of the Inspector, the full XML hierarchy of that window is displayed, both XUL and HTML.

Try it on this page. The JavaScript Debugger gives you control over JavaScript scripts. In any JavaScript code, add this statement:


After the document containing the script loads and that line of code is reached, the debugger is started. Use the big buttons at the top of the debugger to continue loading the page from that point on.

There's a great deal to explore in Mozilla, and this article just scratches the surface. Have a poke around in the chrome directory and see what you can find.

About the author: Nigel McFarlane is a programmer, as well as a science and technology writer and analyst. He is the author of several books on IT, including the recently published Rapid Application Development with Mozilla from Prentice Hall PTR. He is also the author of many articles on the Web, XML and JavaScript, and other technologies. His writing has appeared in many publications.

For more information:

Got questions about Mozilla or Web and software development? Ask Nigel McFarlane.

Find out about differences between Mozilla on Windows and Linux.

Dig Deeper on Linux servers

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.