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:

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.