Greasemonkey: Unset a variable
-
10-07-2019 - |
Question
This is a question that has been plaguing me for awhile.
In Greasemonkey you can use GM_getValue(name)
and GM_setValue(name, value)
to store persistent variables. My question is, how do I 'unset' a variable?
Solution
Try unsetting it by setting it with a blank value:
GM_setValue(name, '')
If that doesn't work:
- Go to
about:config
- Delete the entry
- Restart Firefox
- Run the script
OTHER TIPS
GM_deleteValue
will unset a value set by GM_setValue
,
starting with Greasemonkey version 0.8.20090123 (February 18th, 2009).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow