StorageEvent Class

https://html.spec.whatwg.org/multipage/webstorage.html#storageevent

public sealed class StorageEvent : Event
Inheritance
Event StorageEvent

Constructors

NameDescription
StorageEvent(string, StorageEventInit?)Creates a storage event with the given type and initialization dictionary.

StorageEvent(string, StorageEventInit?)

HtmlEvents.cs

Creates a storage event with the given type and initialization dictionary.

public StorageEvent(string type, StorageEventInit? eventInitDict = null)

Properties

NameDescription
KeyGets the key that was changed, or null when the storage was cleared.
NewValueGets the new value of the key, or null when it was removed.
OldValueGets the previous value of the key, or null when it did not exist.
StorageAreaGets the storage area that changed.
UrlGets the URL of the document whose storage changed.

Gets the key that was changed, or null when the storage was cleared.

public string? Key { get; }

Gets the new value of the key, or null when it was removed.

public string? NewValue { get; }

Gets the previous value of the key, or null when it did not exist.

public string? OldValue { get; }

StorageArea

HtmlEvents.cs

Gets the storage area that changed.

public Storage? StorageArea { get; }

Gets the URL of the document whose storage changed.

public string Url { get; }

Methods

NameDescription
InitStorageEvent(string, bool, bool, string?, string?, string?, string, Storage?)https://html.spec.whatwg.org/multipage/webstorage.html#dom-storageevent-initstorageevent

InitStorageEvent(string, bool, bool, string?, string?, string?, string, Storage?)

HtmlEvents.cs

https://html.spec.whatwg.org/multipage/webstorage.html#dom-storageevent-initstorageevent

public void InitStorageEvent(string type, bool bubbles = false, bool cancelable = false, string? key = null, string? oldValue = null, string? newValue = null, string url = "", Storage? storageArea = null)