7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

StorageEventのブラウザ間差異

Last updated at Posted at 2014-12-15

同一window/別windowそれぞれでStorageを操作した際にStorageEventが発火するか?
IE以外は同一windowでnoなのでsessionStorageのStorageEventは発火する機会がないのだと思う。

同一window 別window
IE(10-11) yes yes
Chrome(39) no yes
Mobile Safari(6-) no yes
Firefox(34) no yes

Storage#setItem()で同一key/valueを設定して変更がない場合にStorageEventが発火するか?

IE(10-11) yes
Chrome(39) no
Mobile Safari(6-) no
Firefox(34) no

Storage#removeItem()した際に発火するStorageEventのpropertyのnewValue
Storageのvalueは文字列なのでnullであれば削除されたと分かるが、
""の場合は""が設定された場合と区別がつかない。

newValue
IE(10,11) ""
Chrome null
Mobile Safari(6-) null
Firefox null

Storage#clear()した際に発火するStorageEventのproperty

key newValue oldValue
IE(10,11) "" "" ""
Chrome "" null null
Mobile Safari(6-) "" null null
Firefox null null null
7
7
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?