GM.deleteValue: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
m (Text replace - "[[Metadata_block" to "[[Metadata Block")
(simplify)
Line 2: Line 2:


== Description ==
== Description ==
This [[API_reference|API]] method deletes an existing preference set by [[GM_setValue]].
Values are deleted from the [http://developer.mozilla.org/en/docs/Code_snippets:Preferences Firefox preferences] back end and can be manually viewed by typing [[mozillazine:About:config|about:config]] in the address bar and searching for the preference name "<code>greasemonkey.scriptvals.[[Metadata Block#.40namespace|namespace]]/[[Metadata Block#.40name|name]].foo</code>".


This method deletes an existing persistent value
See [[GM_setValue]] for details on the storage of these values.


== Syntax ==
== Syntax ==


'''GM_deleteValue(''' ''name'' ''')'''
{{Function|GM_deleteValue|name}}


:Value: Function
Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]]
:Returns: undefined
:Compatibility: [[Version_history#0.8.20090123.1|Greasemonkey 0.8.1+]]


:{| cellpadding="5" style="border-style:solid; background:#FFFFE0;"
== Arguments ==
|+ Parameters
!style="background:#CC9900;"|'''Properties'''
|-
| <code><span style="background:#FFFFE0;">[[#name |name]]</span></code>
|}
:* All properties are optional except [[#name|name]].


=== Properties ===
; <code>name</code>
----
: Property name to delete.  See [[GM_setValue#Arguments|GM_setValue]] for details.
==== <code>name</code> ====
:Value: String
:Usage: <code>'''name''' = "PropertyName";</code>


:* Property name to delete.
== Returns ==


<code>undefined</code>


== Examples ==
== Examples ==
<pre class='sample'>
<pre class='sample'>
GM_deleteValue("foo");
GM_deleteValue("foo");
Line 39: Line 28:


== See Also ==
== See Also ==
* [[GM_getValue]]
* [[GM_getValue]]
* [[GM_setValue]]
* [[GM_setValue]]
Line 45: Line 35:
== Notes ==
== 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.
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.


[[Category:API_Reference|D]]
[[Category:API_Reference|D]]

Revision as of 21:16, 8 February 2010


Description

This method deletes an existing persistent value See GM_setValue for details on 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.

Returns

undefined

Examples

GM_deleteValue("foo");

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.