To the best of my knowledge: localStorage doesn't need any reference, it is implemented in each extension just like chrome.*
localStorage persists through browser shutdowns also. Simply try it out!: localStorage['test']='hai'; If you go to the developer view, then Storage tab, you should see a local storage button for your extension, click it, and you should see the key 'test' with the value of 'hai'. Shutdown the browser, open your extension and go back into the developer/storage/localstorage and see it is still there. On Nov 25, 4:09 am, Rlcrock <[email protected]> wrote: > 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 <[email protected]> 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 <[email protected]> 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 [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<chromium-extensions%2Bunsu > > > [email protected]> > > > . > > > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
