W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2010

Re: StorageEvent.url (WAS: XMLHttpRequest.responseBlob)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 29 Apr 2010 13:01:05 -0400
Message-ID: <4BD9BB51.7070001@mit.edu>
To: Jeremy Orlow <jorlow@chromium.org>
CC: Web Applications Working Group WG <public-webapps@w3.org>
On 4/29/10 12:13 PM, Jeremy Orlow wrote:
> The following script does not work for me in 3.6.  Would love to know
> what I'm doing wrong:
>
> window.onstorage = function() { alert("HI"); }
> localStorage.foo = localStorage.foo + " ";

In Gecko storage events for a change in window X are fired at all 
windows _except_ X that use that localStorage.

This is in fact what the spec says to do.  See 
http://dev.w3.org/html5/webstorage/#localStorageEvent which says:

   When the setItem(), removeItem(), and clear() methods are called
   on a Storage object x that is associated with a local storage area,
   if the methods did something, then in every HTMLDocument object whose
   Window  object's localStorage  attribute's Storage object is
   associated with the same storage area, ****other than x****, a
   storage event must be fired, as described below.

(emphasis added).

> I don't get anything on the error console or any alert.  (Though it
> works in Safari and Opera.)

Sounds like some bugs need to be filed on Safari and Opera.

-Boris
Received on Thursday, 29 April 2010 17:01:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:38 GMT