HowTo: Customize Firefox in the boot-from-CD browser kiosk

InfoDabble > Tech Notes > HowTo > HowTo: Customize Firefox in the boot-from-CD browser kiosk
Jump to: navigation, search

By Eric Hartwell - October 7, 2007

The default Firefox configuration quite naturally assumes it's being used in interactive mode.

For a kiosk application we usually want to restrict the degree of interation allowed.

The kiosk HowTo shows how to use the R-kiosk Firefox extension to force the browser to full screen and disable all menus, toolbars, key commands and right button menus. While R-kiosk does a great job controlling the Firefox interface, there are additional features you may need to control.

For example, Firefox automatically checks for updates and asks the user if they should be installed. This check should be disabled in a boot-from-CD system, since the only effective way to install updates is through a new CD.

Fortunately, Firefox is highly customizable. Browser and extension preferences (including R-kiosk) can be set through configuration files.

[edit] Configuration

Firefox stores its configuration information in a series of xml, html, text, and javascript files. See: http://www.mozilla.org/unix/customizing.html.

For our purposes, there are two important files:

  • prefs.js: Preferences which Firefox can and will overwrite
  • user.js: Personal preferences which Firefox shouldn't overwrite

[edit] User profile

The files are stored in one or more profile directories. Firefox generates a new profile directory on the first boot.

  • Linux: ~/.mozilla/[Linux Login Name]/[random string].slt/
  • SLAX PE: ~/.mozilla/firefox/?random?.default/

Firefox adds a random string to the path of the profile as an extra security measure. While this "makes it a bit harder for vira/etc to obtain the path of the profile", it also makes it much harder to preconfigure a particular profile for boot-from-CD.

[edit] Global preferences

Before the profile-specific settings are applied, Firefox sets the preferences based on default configuration files stored in a system-wide or global preferences directory.

On SLAX, the global preferences are in the directory:

  • /usr/lib/firefox/defaults/profile

This directory is always the same on SLAX and its contents can be set using rootcopy, even on a FAT file system.

[edit] Custom prefs.js

This script sets the Firefox user preferences to prevent security warnings and automatic update, both of which require user interaction.

On SLAX, the final location is /usr/lib/firefox/defaults/profile/prefs.js.

  • One way to set this is to put rootcopy/usr/lib/firefox/defaults/profile/prefs.js in your SLAX image.

Here's an example of a custom preferences file:

# Mozilla User Preferences
 
/* Do not edit this file.
 *
 * If you make changes to this file while the application is running,
 * the changes will be overwritten when the application exits.
 *
 * To make a manual change to preferences, you can visit the URL about:config
 * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
 */
 
user_pref("security.warn_submit_insecure", false);
user_pref("security.warn_submit_insecure.show_once", false);
user_pref("app.update.enabled", false);
user_pref("browser.preferences.advanced.selectedTabIndex", 2);
user_pref("browser.search.update", false);
user_pref("extensions.update.enabled", false);

[edit] Revision History

  • October 7, 2007 - initial version