When I was working on application that uses the addEventListener('storage', handlerFunc, false) I came upon a problem that the handler doesn't do anything. After some searching I found out it was not my application but a bug thats why I'm filling this one Test Case open the url click the button nothing will happen What should happen The console should display: event handler added setItem storage event launched conaiting value: new value old value etc
I have also been testing the storage event and I can't get it to trigger with this test case or almost any other I've tried. Only ones that work are the Layout tests that set the event listener via iframe.contentWindow.onstorage. That way I was able to catch the storage event but getting the storage event normally to window.onstorage definitely seems to have a bug.
This is how it's specced. Please see http://dev.w3.org/html5/webstorage/ "When the setItem(), removeItem(), and clear() methods are called on a Storage object x that is associated with a session storage area, if the methods did something, then in every HTMLDocument object whose Window object's sessionStorage attribute's Storage object is associated with the same storage area, other than x, a storage event must be fired, as described below." and "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." This question has come up a few times, so I'm not convinced it's the right course of action though. Maybe you should bring this up on WhatWG? If so, please cc me?