StorageEvent
BaselineWidely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
TheStorageEvent
interface is implemented by thestorage
event, which issent to a windowwhen a storage area the window has access to is changed within the context of another document.
Constructor
StorageEvent()
Returns a newly constructed
StorageEvent
object.
Instance properties
In addition to the properties listed below, this interface inherits the properties of its parent interface,Event
.
key
Read onlyReturns a string with the key for the storage item that was changed.The
key
attribute isnull
when the change is caused by the storageclear()
method.newValue
Read onlyReturns a string with the new value of the storage item that was changed.This value is
null
when the change has been invoked by storageclear()
method,or the storage item has been removed from the storage.oldValue
Read onlyReturns a string with the original value of the storage item that was changed.This value is
null
when the storage item has been newly addedand therefore doesn't have any previous value.storageArea
Read onlyReturns a
Storage
object that represents the storage object that was affected.url
Read onlyReturns string with the URL of the document whose storage changed.
Instance methods
In addition to the methods listed below, this interface inherits the methods of its parent interface,Event
.
initStorageEvent()
DeprecatedInitializes the event in a manner analogous to the similarly-named
initEvent()
method in the DOM Events interfaces. Use the constructor instead.
Specifications
Specification |
---|
HTML # the-storageevent-interface |