Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The StorageEvent.initStorageEvent() method is used to initialize the value of a StorageEvent.
initStorageEvent(type) initStorageEvent(type, canBubble) initStorageEvent(type, canBubble, cancelable) initStorageEvent(type, canBubble, cancelable, key) initStorageEvent(type, canBubble, cancelable, key, oldValue) initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue) initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue, url) initStorageEvent(type, canBubble, cancelable, key, oldValue, newValue, url, storageArea)
typeArgThe name of the event.
canBubble OptionalA boolean indicating whether the event bubbles up through the DOM or not.
cancelable OptionalA boolean indicating whether the event is cancelable.
key OptionalThe key whose value is changing as a result of this event.
oldValue OptionalThe key's old value.
newValue OptionalThe key's new value.
url OptionalThe URL of the document initiating the change.
storageArea OptionalThe Storage object representing the storage area on which this event occurred.
None (undefined).
| Specification |
|---|
| HTML> # dom-storageevent-initstorageevent> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
initStorageEvent |
4 | 12 | 13 | ≤12.1 | 4 | 18 | 14 | ≤12.1 | 3 | 1.0 | 4.4 | 3 |
StorageEvent().
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent/initStorageEvent