GM.listValues: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m Text replace - "[[Metadata_block" to "[[Metadata Block" |
simplify |
||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
This | This method retrieves an array of preference names that this script has stored. | ||
See [[GM_setValue]] for details on the storage of these values. | |||
== Syntax == | |||
{{Function|GM_listValues|}} | |||
Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]] | |||
== | == Arguments == | ||
None. | |||
== Returns == | |||
<code>Array</code> of <code>String</code>s | |||
== Examples == | == Examples == | ||
<pre class='sample'> | <pre class='sample'> | ||
GM_log(GM_listValues()); | GM_log(GM_listValues()); | ||
</pre> | </pre> | ||
An array of values used by a script: | An array of all values used by a script: | ||
<pre class='sample'> | |||
<pre class='sample | var vals = []; | ||
var vals = GM_listValues(). | for each (var val in GM_listValues()) { | ||
vals.push(GM_getValue(val)); | |||
} | |||
</pre> | </pre> | ||
== See Also == | == See Also == | ||
* [[GM_getValue]] | * [[GM_getValue]] | ||
* [[GM_setValue]] | * [[GM_setValue]] |
Revision as of 21:27, 8 February 2010
Description
This method retrieves an array of preference names that this script has stored. See GM_setValue for details on the storage of these values.
Syntax
function GM_listValues( )
Compatibility: Greasemonkey 0.8.1+
Arguments
None.
Returns
Array
of String
s
Examples
GM_log(GM_listValues());
An array of all values used by a script:
var vals = []; for each (var val in GM_listValues()) { vals.push(GM_getValue(val)); }