Firefox Global Preferences and Properties

 < Day Day Up > 

Firefox is the ultimate in flexible programs. It is possible to almost completely reconfigure Firefox for users specifically (actually user profiles; a user might have several Firefox configurations). Firefox is also able to set preferences for all users, globally. Settings in either the local or global location produce the same effects. Global settings affect all users and local settings affect only that user profile. With global settings, it is also possible to change settings that would be applied to a newly created user profile.

Global Preferences

Firefox (and Thunderbird) reads configuration files located in installation folder/defaults/pref/*.js. In this folder are a number of files. The exact files might vary from version to version of Firefox, but a typical installation has the following files:

  • firefox.js is a file that holds preferences in the same format as prefs.js and user.js.

  • firefox-l10n.js is used to hold location information (such as country and language information).

  • inspector.js holds preferences specific to Firefox's DOM inspector. This tool may be launched from Tools, DOM Inspector.

Firefox.js serves the same basic functionality as prefs.js in the user profile it defines default properties and settings. Changes in this file are global and can affect all Firefox users on the computer.

That said, there is no reason not to alter firefox.js, assuming that you want all users to have a given preference by default. (They can override your settings in firefox.js in their prefs.js or user.js files anyway.)

A global configuration example might be an organization that is distributing Firefox to many employees or members. A company logo might be included, network settings might be preconfigured, and Firefox's chrome (the look and feel) can be altered for all copies. Of course, after a user installs Firefox, he would be able to customize it himself, too.

Global Properties

Preferences are a single setting that tells Firefox how to work. Properties are more complex objects, such as how a font looks (color, size, style, and so on).

Following is a list of the global property locations found in a typical Firefox installation:

  • C:\Program Files\Mozilla Firefox

  • C:\Program Files\Mozilla Firefox\res\

  • C:\Program Files\Mozilla Firefox\res\entityTables\

  • C:\Program Files\Mozilla Firefox\res\fonts\

The following file types might be found in these folders, although some folders differ in the types of files they contain. There might be other file types in addition to these listed:

  • CSS Cascading style sheets define how pages and other objects look.

  • GIF Graphic images, such as buttons, are stored in GIF files. (Any supported graphics format for these types of objects is acceptable, so it is possible that there will be JPG, .BMP, or other graphic formats as well.)

  • Properties Various Firefox properties are described in properties files. These are not formatted the same way that a JavaScript or cascading style sheet file is formatted. Rather they use # to designate comment lines, and data consists of parameter=value lines. A few lines from a .properties file are shown in Listing 6.1.

Listing 6.1 contains a short segment of the file The first three lines are comments and the final three lines are parameter=value data lines. For example, these three lines define how Firefox will handle the ISO-859 character set. There are four ways that the character set might be designated (latin1, latin2, iso_8859-1, and iso8859-1) and they are all mapped to ISO-8859-1.

The entire file consists of about 500 lines of comment and data lines.

Listing 6.1. A Short Segment of a Firefox Properties File
## ## Aliases for ISO-8859-1 ## latin1=ISO-8859-1 iso_8859-1=ISO-8859-1 iso8859-1=ISO-8859-1 

If you are working in a language other than the default and find that some characters are not properly mapped to the correct character set, one place to look would be in

Defaults.ini and Components.ini

In addition to the previously mentioned configuration files, Firefox 1.x and Thunderbird 1.x both read additional configuration files found in user profile\defaults.ini and installation folder\defaults.ini.

The format of each of these files is identical. Defaults.ini describes additional files that might be loaded to set default values. This allows adding additional default initial settings. Components.ini allows for additional component files to be read.

The format of these two files is

[extra files] count=n filename to load 

[extra files] describes the purpose of this .ini file. Count=n, where n is an integer equal to or greater than zero, indicates the count of files to be loaded from the list that follows. Filename to load is the name of a configuration file that is to be loaded.

An example of defaults.ini (taken from one of my Firefox installations):

[Extra Files] Count=1 File0=extensions/{6b6601f1-361e-4b9f-bb6d-f8305000e4f6}/defaults/preferences 


Both defaults.ini and components.ini might also be found in the user's profile. If they are found in the user's profile, they are also read and processed by Firefox. Anything found in the user's profile overrides the global installation folder values.

This says that there is a set of default preferences located in extensions\{6b6601f1-361e-4b9f-bb6d-f8305000e4f6}. That strange set of characters in the braces is the GUID for the GoogleBar extension. Inside the extension's folder is a subfolder called defaults, which has a subfolder named preferences. Defaults are the values that would be used for a new profile's default preferences for the GoogleBar extension. These preferences are stored in a file named googlebar.js.

Changing the preferences for the GoogleBar extension requires that you extract the googlebar.js file from the extension's XPI file, modify it, and then put the modified file back into GoogleBar's XPI file. Then you could distribute this modified extension's XPI file to other users in your organization and they would then have the default preferences you have set.

     < Day Day Up > 

    Firefox and Thunderbird. Beyond Browsing and Email
    Firefox and Thunderbird Garage
    ISBN: 0131870041
    EAN: 2147483647
    Year: 2003
    Pages: 245

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: