I'm using Firefox 10.0 with Greasemonkey 0.9.15. I want to use a userscript, that requires access to local storage. I don't want local storage to be allowed globally.

Is there a way to achieve this goal without modifying userscript?

If userscript modification is necessary, what can I use as the replacement for local storage?

1 Answer 1


The Greasemonkey equivalent of localStorage are the GM_getValue and GM_setValue functions. Just be aware that for example the contemporary Chrome implementation of userscripts doesn't support these (among other things) and if you want your userscripts to work cross-browser, you'll still have to write a fallback function using localStorage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.