Declares a preference that may be adjusted in a
prefpane. This element must be placed inside a
preferences element. Each
preference element corresponds to a preference which is stored in the user's preferences file. You can connect a user interface element such as a checkbox to a preference element using the user interface element's
More information is available in the Preferences System article.
<preferences> <preference id="pref_id" name="preference.name" type="int"/> </preferences>
See Preferences System for a complete example.
commandevent will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to
true, as this will suggest you can set it to
falseto enable the element again, which is not the case.
disabledattribute is allowed only for form controls. Using it with an anchor tag (an
<a>link) will have no effect.
disabledproperty which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
true, the preference will be changed as soon as the user interface is modified.
true, it indicates that the value of the preference is the reverse of the user interface element attached to it. For instance, checking the checkbox disables the preference instead of enabling it.
An onchange attribute is an event listener to the object for the Event change. A change event is fired in different ways for different XUL Input Elements as listed below:
|TextBox||When Enter key is pressed|
|Radio/Check Box||When the state is changed|
|Select List||When the selected item is changed|
The script context at this point can only access the following things:
true, then the user cannot change the value of the element. However, the value may still be modified by a script.
tab" key. Elements with a higher
tabindexare later in the tab sequence.
false. Usually a
checkboxwould be connected to these preferences.
Trueif the preference has been changed from its default value.
trueif either the element has an
instantApplyattribute set to
true, or the
true. (But note bug 451025.)
true, the preference has been locked and disabled in the system configuration, preventing the value from being changed. This property is read-only.
true, then the user cannot modify the value of the element.
name. In pref dialogs with instantApply == true (default on Mac OS X) this value is kept in sync with the actual value stored in the preferences (see valueFromPreferences). When instantApply is off (default on Windows), this gets and sets the current value of the preference in the currently open dialog.
value === undefined, indicating that the preference does not have a user-set value (hasUserValue == false). In this case the actual value to be displayed in the UI is obtained from the defaultValue property.
name. (This always accesses the nsIPrefBranch APIs regardless of the instantApply mode in effect).
textboxit also clears the undo transaction list (Gecko 1.9).
type getElementValue(in DOMElement element);
boolean isElementEditable(in DOMElement element)
true, if the given element is "editable" (see below).
void setElementValue(in DOMElement element);
changeevent is fired on the <preference> element. You can handle this if you wish to.