Menu

GM_listValues

mmartz

Description

This API method retrieves an array of names to values from persistent storage that start with the branch's root.

Currently values are retrieved from a SQLite database located in the Scripts directory. Each script currently has one database named off of the subfolder created after installing a script with a file extension of .db.

Prior to version 1.13 Numbers were limited to integers and no decimal values. Values were deleted from the Firefox preferences back end and could be manually changed by typing about:config?filter=extensions.greasemonkey.scriptvals.namespace/name.foo

| Examples | See Also | Notes

Syntax

GM_listValues()

Value: Function
Returns: String Array
Compatibility: Greasemonkey 0.8.1 - 3.12.0
Access: @grant

Parameters

Properties
  • There are currently no properties.

Examples

| Array of values

Core

GM_log(GM_listValues());

Array of values

var vals = new Array();
for each(var val in GM_listValues())
    vals.push(GM_getValue(val));

Equivalent:

var vals = GM_listValues().map(GM_getValue);

See Also

Notes


Related

Wiki: GM_deleteValue
Wiki: GM_getValue
Wiki: GM_setValue
Wiki: Greasemonkey_Manual:API
Wiki: Scripts_directory
Wiki: Version_history