Configuring Firefox for Chrome and a Server - Running as a Local Installation
(Page 2 of 4 )
We will first look at what we need to install the application on the local machine and to communicate with a server through a form of HTTP request. For both versions, we must have an Apache web server running, PHP installed, and an SQL database up and running.
Chrome Directory Structure An application registered as a chrome package is not required to be located in a specific directory; convention, however, has placed most chrome applications within Firefox’s chrome directory. The chrome directory is located in the same directory as the binary executable for Firefox. Most of the files in the chrome directory are .jar files, or Java archive files.
Although XUL applications use the Java archive as a preferred distribution medium, the source code files are not written in Java. XUL applications are developed as JavaScript and XUL source files.
To see the content of any of the archives, usethe
jar –tfcommand. For example, to view the contents of the inspector.jar file, change to the chrome directory and type the following:
jar –tf inspector.jar
If we were to do the same for all the archive files, we would see that they share a common directory structure:
Content
For user interface (XUL) files, stylesheets, and scripts
Skin
Stylesheets and images that collectively provide a
theme to an appearance
Locale
To provide multiple-language support for interface
widgets
For our application, we will work with only thecontent root.
Before we continue installing our application in the Firefox chrome directory, we need to understand that such an application is referred to through a special chrome URL. The form of this URL is:
chrome://<package>/<part>/<fileName>
Thepackage andpart names are consistent with conventions used for .jar files. This URL instructs the Firefox framework to scan its installed packages to access a filename located as part of a specific package. Once our application is registered, we would use a command line with the–chromeoption (to open the file in a chrome window) or specify a chrome URL (to launch the application with chrome privileges):
firefox –chrome chrome://<package>/<part>/<filename>
Figure 4-3 illustrates an example directory structure.

Figure 4-3. Chrome directory structure
Next: Package Registration >>
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.
|
|