Re: DOM Storage feedback

On Thu, 19 Jun 2008, Adam Roben wrote:
> 
> I've been worried a bit recently about the synchronous API for reading 
> from localStorage. It seems like it would be very common for pages to 
> access localStorage early in the lifetime of the page to restore state 
> from the last browsing session, and even with an ahead-of-time read it's 
> entirely possible that we won't have finished reading off the disk by 
> the first access. In this case, the whole browser will hang.
> 
> One possible solution to this problem would be to have an event that 
> fires when localStorage is ready for reading (perhaps called 
> "localstorageready"). Before that event fires, all attempts to read from 
> localStorage will fail (perhaps writes should fail as well, for 
> consistency?). After the event fires, localStorage can be used normally.

I would imagine that localStorage would load faster than DNS, usually, so 
this seems like an unnecessary worry. You already have to wait til you've 
loaded all the cookies for that domain, why would you have significantly 
more trouble waiting for the storage data?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 24 December 2008 12:00:07 UTC