GM.listValues: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
→Examples: adding example from http://userscripts.org/topics/34069 by charmy |
under to dot in API link; mention more explicitly that the strings are value _names_ |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{DISPLAYTITLE:GM_listValues}} | ||
== 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#4.0_2|Greasemonkey 4.0+]] | |||
=== Arguments === | |||
None. | |||
=== Returns === | |||
[[ | A [[Promise]], rejected in case of error and otherwise resolved with an <code>Array</code> of <code>String</code>s names for previously set values. | ||
== Examples == | == Examples == | ||
<pre class='sample'> | |||
console.log(await GM.listValues()); | |||
</pre> | |||
</pre> | |||
== See Also == | == See Also == | ||
* [[GM.getValue]] | |||
* [[GM.setValue]] | |||
* [[GM.deleteValue]] | |||
[[Category:API_Reference|L]] | [[Category:API_Reference|L]] |
Latest revision as of 20:49, 20 October 2022
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 4.0+
Arguments
None.
Returns
A Promise, rejected in case of error and otherwise resolved with an Array
of String
s names for previously set values.
Examples
console.log(await GM.listValues());