On Monday, December 17, 2012 1:57:43 PM UTC-8, David Flanagan wrote:
> On 12/17/12 12:35 PM, Noit wrote:
> 
> > So Im working hard to release an app but I cant use localStorage! Because 
> > data is stored as a string, when i call it, back the data is still a 
> > string. I can't use eval!! How can I use eval?
> 
> If you're trying to write a generic unprivileged webapp, you ought to be 
> 
> able to use both localStorage and eval().  If you're trying to write a 
> 
> Gaia app or otherwise create an app with privileges, you may be running 
> 
> up against some performance and security restrictions.  I don't actually 
> 
> know the details, but I think we disabled localStorage for Gaia apps 
> 
> because its synchronous API performs so poorly.  And I believe that 
> 
> using eval() violates our CSP security model for privileged apps.
> 
> 
> 
> gaia/shared/js/async_storage.js defines a asynchronous alternative to 
> 
> localStorage that you might find helpful. And you probably shouldn't be 
> 
> using eval() anyway.  Would JSON.parse() work instead?
> 
> > Man this app dev experience has been misreable.
> 
> There's a lot of developer documentation we still need to write, to 
> 
> introduce new developers to the ins and outs of developing FirefoxOS 
> 
> apps.   Your feedback will be valuable.  (Welcome to the bleeding edge :-)
> 
> 
> 
>      David Flanagan
> 
> 
> 
> > _______________________________________________
> 
> > dev-b2g mailing list
> 
> > dev-b2g@lists.mozilla.org
> 
> > https://lists.mozilla.org/listinfo/dev-b2g

Thanks David! JSON.parse would be perfect! Ah ew i didnt know localStorage was 
sync. I don't know if it's gaia I just picked up the list demo app and started 
hacking it up.

Ill look into the  async_storage.js I dont think im using gaia though, Im not 
sure.

There is so much code in this list demo app I cant figure out what its all for.
_______________________________________________
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to