K-Meleon
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:
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.
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:
To restore a single preference to the default:
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 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:
pref("general.config.obscure_value", 0); // optional, defaults to ROT-13 pref("general.config.filename", "mozilla.cfg");
Then you can create the config itself:
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 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. |
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 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.