GM.getValue: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Line 4: Line 4:
== Syntax ==
== Syntax ==


'''GM_getValue(' name'', ''default ')'''
'''GM_getValue(''' ''name'', ''default'' ''')'''


== Description ==
== Description ==

Revision as of 20:24, 4 December 2007

Template:Underscore

Syntax

GM_getValue( name, default )

Description

Retrieve a value set with GM_setValue. Values are saved in the 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"));

See also