Team LiB
Previous Section Next Section

Hack 85. Study Packages with the Chrome Manager

Demystify the way the chrome system is organized with this handy tool.

The XML dialect called RDF is not exactly a simple system to use, and Firefox relies on RDF files a lot. This hack shows how to use the Chrome Manager tool, an extension that provides a simple breakdown of these complex structures. Together with the InfoLister extension [Hack #38], you can get a complete picture of what's installed in the chrome.

8.3.1. Get the Chrome Manager

This useful extension is buried where it's hard to find. It's written by Karsten Düsterlo as part of the larger and cryptically named Mnenhy extension. "Mnenhy" stands for Mail-News ENHancement-Y. Whatever. You can install it from here:

http://mnenhy.mozdev.org/

The beauty of this extension is not its mail and news features any more than it is its cryptic name. Its beauty is in the small Chrome Manager tool that's included almost as an afterthought. Mnenhy can be safely installed as an extension in Firefox, but at the time of writing (at Version 0.7), not all of its features are complete or reliable. You've been warned. It is safe to use as a view-only tool; don't make changes with it unless you are an expert.

8.3.2. Chrome Simplified

Figure 8-1 shows the initial window that the Chrome Manager presents.

Figure 8-1. The Chrome Manager window, with highlighted danger buttons


It's strongly recommended that you don't push any of the buttons circled in Figure 8-1. You might regret it if you do. Avoid the temptation, or else study the online help before diving in bravely.

What's important about this window is the division of all the chrome that Firefox possesses into three simple categories: packages, skins, and locales. In the end, these things are all that the chrome has to offer and all that can be accessed using the special chrome: URL. So, all the confusion about themes, skins, extensions, locales, and so on is really just matter of labels; all these things boil down to those three simple categories.

This display is derived from all the aggregated RDF information that Firefox keeps in memory [Hack #75] while it's running.

8.3.3. Understand Packages

Figure 8-2 shows the packages part of the chrome hierarchy opened up one level.

Figure 8-2. The Chrome Manager, showing packages


In Figure 8-2, underlined package names are installed in the profile area. As you can see, all underlined packages are named after an extension, and each extension adds exactly one package. That's the normal case, but not an absolute rule. If you bring up this display and scroll down, you'll see that the Mnenhy extension provides seven packages.

More interestingly, the package names that are marked as applications are the ones that are provided with the default install of Firefox. They reside in the install area, but they're still just packages. In Figure 8-2, you can see the browser package that is the main Firefox interface, the help system, the Cookie Manager, the DOM Inspector, and even a bit of leftover Netscape Communicator 4.x in the communicator package. It hasn't been completely deprecated yet. In short, the entire Firefox user interface, including extensions, is just a set of packages. If this window is rearranged and manipulated a little, Figure 8-3 results.

Figure 8-3. The Chrome Manager, showing contributed skins


Here, the relationship between packages, locales, and skins is made obvious. The browser package (Firefox itself, appearing at line 8) is well supported by the five or so additional themes that have been installed. There's a skin for the browser package from each of those five themes, plus the default theme's skin. The lesser-known addneditcookies package has received no special skins from those themes. That's the price of obscurity. Fortunately, there's always a global skin, and all packages can trivially benefit from that. Similarly, the only locale that contributes to the browser is the default of en-US (U.S. English). The addneditcookies package has only that locale as well, so that extension can't be installed in the German version of Firefox; if it were, it would be missing the required de-DE locale, and no text would appear in its user interface. It should be enhanced.

8.3.4. Packages Versus Extensions

It's revealing to compare the Chrome Manager with the report generated by the InfoLister extension [Hack #38] . The Chrome Manager reports on the low-level packages, locales, and skins that make up all the user-interface content. The InfoLister window reports the names of the products that delivered those packages: extensions, plug-ins, and themes. It's the latter information that's used to check for updates across the Web. The lower-level information is what Firefox uses when it needs to display a window or dialog box.

    Team LiB
    Previous Section Next Section