Re: Is localStorage read and write-able offlne?

2009-07-31 Thread João Eiras



Everything in file:// is the same origin.  I think Mozilla has
been experimenting with changing this, but I can't remember how they handle
localStorage (if it's even different at all).



No. Everything on file:// has the origin defined by the origin serialization 
algorithm.
http://dev.w3.org/html5/spec/Overview.html#origin
The spec tells If scheme is file, then the user agent may return a UA-specific 
value.
In Opera's case we use file://machine/ where machine can be localhost, an ip, 
or a remote computer with a shared folder.
If you're on a local network which cannot be fully trusted, accessing a page at 
file://peer/ that manages to access your local harddrive is as serious as a 
cross-domain attack, or even more.
So saying that everything on file has origin file:// is a misconception of the 
problem origin tries to solve.



Re: Is localStorage read and write-able offlne?

2009-07-30 Thread Jeremy Orlow
When used in conjunction with AppCache, the offline behavior of localStorage
should be reasonably deterministic.  I assume you were just using a page
that had been normally cached and things weren't working 100%?

2009/7/30 ~:'' ありがとうございました j.chetw...@btinternet.com

 Is localStorage read and write-able offlne?

 http://dev.w3.org/html5/webstorage/
 admittedly only a skim-read, but could not find any reference?


 testcase: https://bug506639.bugzilla.mozilla.org/attachment.cgi?id=390836

 works in a local directory with cookies for Opera and Safari,
 but Mozilla using localStorage requires the file to be online to be read or
 written to.
 bug filed: https://bugzilla.mozilla.org/show_bug.cgi?id=507361

 from a developer perspective this can be frustrating.
 presumably users working offline might also expect to be able to read and
 write as per cookies...

 best

 ~:






Re: Is localStorage read and write-able offlne?

2009-07-30 Thread Boris Zbarsky

Jeremy Orlow wrote:
I don't know what you mean by this.  LocalStorage only cares about the 
origin.


Ah, indeed.  I'd gotten lost in all the spec changes in this area...

For reference, https://bugzilla.mozilla.org/show_bug.cgi?id=495337

-Boris