StorageEvent
The StorageEvent interface is implemented by the storage event, which is sent to a window when a storage area the window has access to is changed within the context of another document.
Constructor
StorageEvent()-
Returns a newly constructed
StorageEventobject.
Properties
In addition to the properties listed below, this interface inherits the properties of its parent interface, Event.
-
keyRead only -
Returns a
DOMStringthat represents the key changed. Thekeyattribute isnullwhen the change is caused by the storageclear()method. -
newValueRead only -
Returns a
DOMStringwith the new value of thekey. This value isnullwhen the change has been invoked by storageclear()method, or thekeyhas been removed from the storage. -
oldValueRead only -
Returns a
DOMStringwith the original value of thekey. This value isnullwhen thekeyhas been newly added and therefore doesn't have any previous value. -
storageAreaRead only -
Returns a
Storageobject that represents the storage that was affected. -
urlRead only -
Returns
DOMStringwith the URL of the document whosekeychanged.
Methods
In addition to the methods listed below, this interface inherits the methods of its parent interface, Event.
-
initStorageEvent() -
Initializes the event in a manner analogous to the similarly-named
initEvent()} method in the DOM Events interfaces. Use the constructor instead.
Specifications
| Specification |
|---|
| HTML Standard (HTML) # the-storageevent-interface |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
StorageEvent |
1 |
12 |
13 |
9 |
≤12.1 |
≤4 |
≤37 |
18 |
14 |
≤12.1 |
≤3 |
1.0 |
StorageEvent |
17 |
17 |
13 |
No |
15 |
6 |
≤37 |
18 |
14 |
14 |
6 |
1.0 |
initStorageEvent |
4 |
12 |
13 |
9 |
≤12.1 |
≤4 |
≤37 |
18 |
14 |
≤12.1 |
≤3 |
1.0 |
key |
1 |
12 |
13 |
9 |
≤12.1 |
≤4 |
≤37 |
18 |
14 |
≤12.1 |
≤3 |
1.0 |
newValue |
1 |
12 |
13 |
9 |
≤12.1 |
≤4 |
≤37 |
18 |
14 |
≤12.1 |
≤3 |
1.0 |
oldValue |
1 |
12 |
13 |
9 |
≤12.1 |
≤4 |
≤37 |
18 |
14 |
≤12.1 |
≤3 |
1.0 |
storageArea |
3 |
12 |
13 |
9 |
≤12.1 |
≤4 |
≤37 |
18 |
14 |
≤12.1 |
≤3 |
1.0 |
url |
6 |
12 |
13 |
9 |
≤12.1 |
5 |
≤37 |
18 |
14 |
≤12.1 |
5 |
1.0 |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent