GM.getValue: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m →Description: - Malformed external link/Fixed broken link |
|||
Line 8: | Line 8: | ||
== Description == | == Description == | ||
Retrieve a value set with [[GM_setValue]]. Values are saved in the [http://developer.mozilla.org/en/docs/Code_snippets:Preferences | Retrieve a value set with [[GM_setValue]]. Values are saved in the [http://developer.mozilla.org/en/docs/Code_snippets:Preferences Firefox preferences] back end and can be changed by typing <code>about:config</code> in the address bar and searching for the preference name "greasemonkey.scriptval.''script-namespace''/''script-name''. | ||
If the value is not found, default is returned instead. | If the value is not found, default is returned instead. |
Revision as of 01:08, 5 December 2007
Syntax
GM_getValue( name, default )
Description
Retrieve a value set with GM_setValue. Values are saved in the Firefox preferences back end and can be changed by typing about:config
in the address bar and searching for the preference name "greasemonkey.scriptval.script-namespace/script-name.
If the value is not found, default is returned instead.
If default is not supplied, undefined
is returned.
Examples
alert(GM_getValue("foo"));