Configuring Firefox for Chrome and a Server - Package Registration
(Page 3 of 4 )
Every time the Firefox browser launches, its framework looks for any file with an extension of .manifest to inform it of the chrome content packages, skins, or locales that need to be loaded. To inform Firefox of our NewsSearch application, we will use a text editor to create a line for a file named localApps.manifest (any unique filename with a .manifest extension will do) and save it in Firefox’s chrome directory:
content newssearch NewsSearch/content/newssearch.xul
The format of this line consists of space-delimited entries as follows:
- The first field,content, declares the installation to be a content package. Other options includeskinandlocale.
- Thenewssearchentry names the package.
- The last entry is the source file location relative to the chrome directory.
We can now launch Firefox and type the chrome URL directly in the locator window to launch the same application, but within a browser window (see Figure4-4 ).

Figure 4-4. Specifying the package name, and specifying the package type as a chrome URL
Once we make this entry in the URL bar, Firefox will autocomplete the line to add the filename that matches the package name—in this case, our newssearch.xul file.
Alternatively, we could launch our application directly from the command line, using the–chromeoption and a chrome URL that specifies our package name and package type:
firefox –chrome chrome://newssearch/content/
Figure 4-5 illustrates the results of launching our chrome application from the command line and entering correct login information, for both a Windows and an OS X implementation of the same code.
XUL-to-Server Communications A user can communicate to a server using several models, including a XUL application that runs locally while obtaining needed server information through asynchronous HTTP requests. Using this approach, the local application is in complete control of the user interface, with the server providing only textual information in response to requests. Here are the steps for implementing this model:
- Configure a web server.
- Install a scripting language to provide logic that manages communications with a client application.
- Implement the communication connection between the application and the server.
- Add a database on the server to communicate with the scripting language.

Figure 4-5. OS X and Windows presentation of newssearch.xul (after simulated login)
Next: Configuring the Server >>
More Web Standards Articles
More By O'Reilly Media
|
This article is excerpted from chapter four of Programming Firefox, written by Kenneth C. Feldt (O'Reilly, 2007; ISBN: 0596102437). Check it out today at your favorite bookstore. Buy this book now.
|
|