K-Meleon

Content
  - Preferences
   - About:config
   - .js files
   - Mozilla.cfg
  - Config files
  - Skins
  - Macros

K-Meleon stores settings as preferences, or prefs. The browser uses many Mozilla-derived preferences as well as K-Meleon-specific preferences. K-Meleon stores changes from the browser's interface, including the preferences dialog, as prefs. There are also many hidden settings and capabilities that you can access through several methods:

  • About:config is a hidden interface in the browser.
  • Javascript files (including prefs.js and user.js) store preferences in the file system.
  • Config files can be edited in any text editor.
  • Skins usually include config or javascript files.
  • Macros can modify preferences while K-Meleon is running.

Preferences

The simplest way to set preferences in K-Meleon is through the browser's interface. There are also several more advanced ways to modify preferences. Note that these more technical methods to modify settings are actually affecting the same values as when you make changes via the GUI. For example, if you copy about:config?filter=kmeleon.general.toolbars_locked and paste it into the address bar you'll see whether or not your toolbars are locked. If you then toggle this from View > Toolbars > Lock Toolbars you'll see the value change in real-time.

About:config

To open the about:config page, type about:config in the address bar and press enter. On the about:config page, only the bold preferences have been modified. If you see italic preferences these are locked. The rest are displaying the browser's default settings. When you close K-Meleon, modified preferences will be saved to prefs.js in your profile. When you restart K-Meleon, prefs.js will override the default preferences, and preferences in user.js will override both.

To modify a preference on the about:config page:

  1. Type about:config into the address bar and press enter. If a warning appears, click the button to proceed.
  2. Begin typing any part of the preference name into the search bar. It will filter out other results as you type.
  3. Right-click the name of the preference and select Modify or Toggle. Boolean preferences can be toggled on or off. Integer or string preference will have a value to modify.

To restore a single preference to the default:

  1. Type about:config into the address bar and press enter. If a warning appears, click the button to proceed.
  2. Begin typing any part of the preference name into the search bar. It will filter out other results as you type.
  3. Right-click the name of the preference and select Reset.


.js files

Preferences can be set in plain text Javascript files known as .js files. By default, there are several .js preference files in your K-Meleon installation. They will use the syntax below:

pref("Preference Name","string value");
pref("Preference Name", numerical value); //integer
pref("Preference Name", boolean value); //true or false

Note that the structure has 3 parts. First, pref() triggers a javascript function. Second, a preference name is provided as an argument. Third, a preference value is provided. The names and values will be identical to those on the about:config page.

Changes made in the about:config page are directly transferred to prefs.js in the user's profile. Deleting or renaming prefs.js will cause K-Meleon to recreate the file the next time K-Meleon starts with default settings. There is also a user.js file in each profile. This is a place for custom preferences that will override those saved to prefs.js.

Many of the default settings for Mozilla browsers were originally stored in separate .js files, but were later consolidated. In K-Meleon 75 and up these Mozilla preferences still exist but are bundled inside of omni.ja, an archive containing many systems files. K-Meleon-specific preferences often use the separate .js file approach. Several important .js files containing prefs are stored in a user's profile and the K-Meleon/browser/defaults/preferences/ folder, including:

prefs.js profile Settings for the current user are stored here.
user.js profile Custom settings. See the user.js page for details.
kmeleon.js default K-Meleon-specific settings.
kmprefs.js default K-Meleon-specific settings.
kmprefs-additional.js default Additional K-Meleon-specific settings.
sI10n.js default Browsing and search settings.
skin.js default Default visibility and position of toolbars for K-Meleon. The skin.js file in a skins' folder overrides this.
xpi.js default Setting to install legacy Firefox extensions.


Mozilla.cfg

Mozilla.cfg provides a way to set preferences across many computers. Mozilla.cfg allows you to lock preferences for other end users. It will not be present in K-Meleon's default installation. If you would like to use it in K-Meleon first you must tell K-Meleon to load it:

  1. Close K-Meleon if the browser is open.
  2. Navigate to the K-Meleon/browser/defaults/preferences/ folder. You should see several .js files.
  3. Create a new text file and name it local-settings.js
  4. Open local-settings.js in any text editor.
  5. Copy the code below, paste it into the file, and save.
 pref("general.config.obscure_value", 0); // optional, defaults to ROT-13
 pref("general.config.filename", "mozilla.cfg");

Then you can create the config itself:

  1. Close K-Meleon if the browser is open.
  2. Navigate to the root K-Meleon folder where K-Meleon.exe is located.
  3. Create a new text file and name it mozilla.cfg
  4. You can now write prefs to this file. Be sure to save the file ANSI encoded. By default, K-Meleon will expect it to be ROT-13, but local-settings.js can override this as explained above.
  5. Before saving make sure the first line is a comment. You can copy and paste the example below:
    // NOTE: Code must begin on the second line.

Mozilla.cfg can use the pref() function, but it has 2 additional ways to set prefs that are useful in larger organizations:

defaultPref(); Set new default value. Users can permanently change this.
pref(); Set value at startup. Users can change during a session but it will reset when K-Meleon closes.
lockPref(); Lock the value. Users cannot change this during a session. The preference will be in italics on the about:config page and user interface features like checkboxes should be greyed out.


Config files

Config files are human-readable text files that also contain many settings. These are K-Meleon-specific and are not modified by the browser. They're intended to be customizable to end users in a text editor. Refer to the ConfigFiles page for more information. A summary is below:

toolbars.cfg Defines toolbar buttons. Can be stored in individual skins in all versions. As of version 75, skins can also use a config stored in the user's profile. If neither are present K-Meleon will use the config from the K-Meleon/Browser/settings/defaults/ folder.
menu.cfg Defines menu entries.
accel.cfg Defines keyboard accelerators or shortcuts.
menuicons.cfg Defines the menu icons for a particular skin. Also defines default icons for toolbar buttons as of version 75.
skin.cfg Json file that defines menu icons and default toolbar icons for newer 75-style themes.


Skins

In K-Meleon, skins determine the available toolbars via toolbars.cfg. For more information on toolbars.cfg refer to the ConfigFiles page. The skin.js file (if present in a skin) will create the default settings when using a specific skin. For more information about skins and customization via skins refer to the theming tutorial.


Macros

Macros can make changes to settings while the browser is running. These will appear in about:config and will be saved to pref.js in the user's profile. Macro commands for handling preferences include:

delpref( prefName ); Deletes the specified preference. This will restore the default if it exists. Otherwise, the preference is expunged.
$VALUE = getpref( TYPE, "user.preference.variable" ); Gets a preference's current value. TYPE:
BOOL, INT, STRING
setpref( TYPE, "user.preference.variable", VALUE ); Sets a user preference. TYPE:
BOOL, INT, STRING
togglepref( TYPE, "user.preference.variable"[, VALUE1, VALUE2, ... ]); Toggles a user preference between a series of values (booleans always toggle between true and false). TYPE:
BOOL, INT, STRING

Refer to the Macro Language Reference for more information.


Additional links

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.