I'm certainly not an expert on localStorage but this: <https://developer.mozilla.org/en/DOM/Storage#localStorage> seems to state that "domain-specific" means there's a separate instance of a variable per domain, so the code below should work on any domain, it's just that you'll have a different foo per domain (not that that will be noticeable with the code below, but it could be modified so it is).

Brian

You are using it correctly. See my previous message, indication that localStorage is domain-specific. It's not intended for cross-domain purposes, for obvious security reasons.


On 1/24/2011 7:29 AM, nw wrote:
Tried this script with firefox 3.6.13 and GM 0.9:

// ==UserScript==
// @name           testScript
// @namespace      testScript
// @include        http://*
// @include        https://*
// ==/UserScript==

localStorage.setItem('foo', 'bar');           //line 1
alert(localStorage.getItem('foo'));

I get the alert message "bar" only on google domain, apparentlly.
Other websites generates some "Security error" on line 1 in Error
Console.

What is the correct way to *et values with localStorage?

Your help is much appreciated. Thank you !

--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to