Just to be clear, I can use localStorage as if it were an array
without including an external reference?  Also, localStorage is
specific to my extension and is not session specific, so I shouldn't
have to worry about shared storage space or losing data when the
browser session ends, correct?

On Nov 24, 10:26 pm, Finnur Thorarinsson <fin...@chromium.org> wrote:
> Well, you can always take your datastructure, convert it to string using
> JSON.stringify(...) and store that in a single variable using localStorage.
> Then, when you need the data, get the string from localStorage and convert
> it back to your datastructure using JSON.parse(...).
>
> Search for JSON to see example usage from our RSS extension 
> sample:http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/exte...
> There are also some reference pages on the internet on how to use the JSON
> object if the sample doesn't make it clear.
>
> --Finnur
>
>
>
> On Tue, Nov 24, 2009 at 19:00, Rlcrock <rlcr...@gmail.com> wrote:
> > I am new to developing extensions, and I am confused on how
> > localStorage works, and if I even need to use it.  I am trying to
> > write an extension which can open a group of URLs the user has defined
> > through my options page.  I want to allow them to have multiple
> > arbitrarily sized groups (e.g. one group with 4 urls, another with 16,
> > another with 10) and have my extension open all the URLs in a group
> > into the same window.  My original thought was to store each group as
> > a separate text file somewhere locally, but I have hit some walls as
> > far as storing data via Javascript.  Is there a better way to do this?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2Bunsu 
> > bscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/chromium-extensions?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to