GM_listValues

supahgreg edited this page Dec 2, 2010 · 2 revisions

Description

GM_listValues retrieves an array of user script preference names.

Note: This does not return the stored value of a preference. You must use GM_getValue to retrieve the stored value after getting the preference name.

Arguments

none

Returns

[String]

Example

GM_setValue("a", true);
GM_setValue("b", "Yay!");
GM_setValue("c", 3);

var myPrefs = GM_listValues(); // myPrefs is now ["a", "b", "c"]

for (var i=0; i < myPrefs.length; i++) {
  GM_log(myPrefs[i] + " is: " + GM_getValue(myPrefs[i]));
}