A StorageEvent
is sent to a window when a storage area it has access to is changed within the context of another document.
Note: Although this event existed prior to Gecko 2.0, it did not match the specification. The old event format is now represented by the nsIDOMStorageEventObsolete
interface.
void initStorageEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in DOMString oldValueArg, in DOMString newValueArg, in DOMString urlArg, in nsIDOMStorage storageAreaArg); |
Attribute | Type | Description |
---|---|---|
key | DOMString | Represents the key changed. The key attribute is null when the change is caused by the storage clear() method. Read only.
|
newValue | DOMString | The new value of the key . The newValue is null when the change has been invoked by storage clear() method or the key has been removed from the storage. Read only.
|
oldValue | DOMString | The original value of the key . The oldValue is null when the key has been newly added and therefore doesn't have any previous value. Read only.
|
storageArea |
| Represents the Storage object that was affected. Read only. |
url | DOMString | The URL of the document whose key changed. Read only.
|
Initializes the event in a manner analogous to the similarly-named method in the DOM Events interfaces.
void initStorageEvent( in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in DOMString oldValueArg, in DOMString newValueArg, in DOMString urlArg, in nsIDOMStorage storageAreaArg );
typeArg
canBubbleArg
cancelableArg
keyArg
oldValueArg
newValueArg
urlArg
storageAreaArg
Storage
object representing the storage area on which this event occurred.Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 1 | ? | Yes | ? | Yes | ? |
StorageEvent() constructor |
17 | ? | Yes | ? | Yes | ? |
initStorageEvent
|
Yes | ? | Yes | ? | Yes | ? |
key |
1 | ? | Yes | ? | Yes | ? |
newValue |
1 | ? | Yes | ? | Yes | ? |
oldValue |
1 | ? | Yes | ? | Yes | ? |
storageArea |
3 | ? | Yes | ? | Yes | ? |
url |
5 | ? | Yes | ? | Yes | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | ? | Yes | Yes | ? | ? |
StorageEvent() constructor |
Yes | Yes | ? | Yes | Yes | ? | ? |
initStorageEvent
|
Yes | Yes | ? | Yes | Yes | ? | ? |
key |
Yes | Yes | ? | Yes | Yes | ? | ? |
newValue |
Yes | Yes | ? | Yes | Yes | ? | ? |
oldValue |
Yes | Yes | ? | Yes | Yes | ? | ? |
storageArea |
Yes | Yes | ? | Yes | Yes | ? | ? |
url |
Yes | Yes | ? | Yes | Yes | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent