Bug with Chrome's localStorage implementation?

前端 未结 2 979
渐次进展
渐次进展 2020-11-29 08:35

Further to this question, I\'m getting a curious result when binding a function to the change event of the Storage object in Chrome 8.0.552.224.

The test:

         


        
2条回答
  •  情歌与酒
    2020-11-29 08:58

    Ivo Wetzel's answer for what is going wrong is correct.

    I was having the same problem but managed to work around this limitation in the spec by manually creating and firing a StorageEvent in the tab that initiated the storage change (see StorageEvent#initStorageEvent).

提交回复
热议问题