GM.deleteValue

From GreaseSpot Wiki
Revision as of 00:42, 11 May 2011 by Kwah (talk | contribs) (added descriptions to code examples;)
Jump to navigationJump to search


Description

This method deletes an existing name / value pair from storage.

See GM_setValue for details regarding the storage of these values.

Syntax

function GM_deleteValue( name )

Compatibility: Greasemonkey 0.8.1+

Arguments

name
Property name to delete. See GM_setValue for details on what names are valid.

Returns

undefined

Examples

Delete the stored name / value pair that has the name 'foo':

GM_deleteValue("foo");

Example showing the use of GM_listValues to delete all stored name / value pairs:

var keys = GM_listValues();
for (var i=0, key=null; key=keys[i]; i++) {
  GM_deleteValue(key);
}

See Also

Notes

An issue that some may encounter on some platforms is that the values appear to not be deleted or set. This is usually due to a refreshing issue in the browser. If about:config is refreshed in the window/tab this should resolve any questions about stability of setting and deleting system preferences.