Preferences (Definition)

Browser preferences can sometimes be manipulated from JavaScript.

Netscape 4.0 introduced some new methods for storing preference settings in external JavaScript configuration files. Earlier version required an Admin Kit to be used to set defaults and the user could then only modify preferences from the options menu.

The JavaScript preferences information is contained in:

The prefs.js file contains a collection of user preferences. It is read by the browser as it starts up and written by the browser as it shuts down. If you want to modify prefs.js by hand, you will need to do it while Netscape is not running. There are a few modifications that can be done to this file that will help when you are developing JavaScript source code.

Note that you can have a different prefs.js file for each user profile. On UNIX versions of Netscape Navigator, the prefs.js file becomes preferences.js instead.

Additional preference information may be stored in a file called netscape.cfg, which replaces the netscape.lck found on older versions of Netscape. This file overrides the settings in prefs.js but is not written to by the browser. It is an encrypted file that you cannot unwrap without a lot of work. It is possible to edit it carefully by hand but you really need the admin tools from Netscape to work on it. There is a tool called Mission Control that contains a configuration editor. There is also an install builder for delivering an encrypted file to the target system.

The third file is called config.jsc and overrides the other two. This file will likely only be present if you are running under the supervision of an administrator who uses the admin tools to configure hundreds of browsers. The config.jsc file can be loaded from a URL defined in netscape.cfg. Furthermore it can be read frequently and regularly by the browser so it is possible to turn features on and off during the day having configured netscape.cfg to re-read it from time to time.

Using these configuration scripts and the tools that Netscape provides, you can alter hundreds of parameter settings within the browser.

See also:.js, netscape.lck


Wrox Instant JavaScript - page - 59