On Sun, Nov 29, 2009 at 6:34 PM, Devdatta <dev.akh...@gmail.com> wrote: >> 3) One of the things we found in our study (which Adrienne has made >> public at >> <http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/EECS-2009-139.pdf>) >> is that many extensions use nsIFile to store extension-local >> persistent state. You might consider providing an alternative API >> (e.g., something like localStorage) that lets Jetpacks store >> persistent state without the authority to read and write arbitrary >> files. > > The study says that extensions use nsIFile to 'store information that > is too complex for the preferences system'. What is 'too complex' ? If > a key value store (viz. the preferences system) isn't good enough, > would localStorage work ? Do you have a list of extensions for whom > localStorage would be good enough (but can't work with just the > preferences system) ?
That's a good question for Adrienne, but my understanding is the prefs system can only store simple types like integers and booleans. Now that JSON.stringify and JSON.parse are implemented in Firefox, localStorage can store many interesting objects. I think the HTML5 spec also as support for storing things like images in localStorage, but I'm not sure that's implemented in Firefox yet. It's possible that we could design a persistent storage API that's better optimized for extensions, but I think it makes sense to re-use interfaces the web platform whenever possible. For example, if jQuery adds an abstraction for localStorage, Jetpacks can use that for free. Adam _______________________________________________ dev-security mailing list dev-security@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-security