I am trying to troubleshoot this by capturing any storage events that remove values from local storage. I have an always open dummy page that begins an event listener on load as such:
window.addEventListener("storage", function (evt) { if (evt.newValue == null || (evt.oldValue != "" && evt.newValue == "")) {alert(evt.url);} });
The listener fires just fine. That is not the issue. My issue is that the alert(evt.url)
returns "undefined" in mobile browsers. Works just fine on Chrome.
The device is the Samsung Galaxy Tab running Gingerbread OS. The browsers are Dolphin HD and the stock webkit browser.
Edit: Tried it on the iPhone and all works just fine on Safari. Also, the problem only seems to pertain to the url attribute. oldValue
, newValue
and key all return values.