Skip to content

Storage

Generated from idl/html.webidl when the site was built at 7aa23e2.

Storage is an interface in idl/html.webidl, exposed in Window. What it does is on MDN; this page says what niso has of it.

The standard declares getItem, setItem and removeItem as the named property getter, setter and deleter; niso-idl takes named properties as anonymous operations, so they appear twice.

Web Storage runs on the storage driver, SQLite by default, which a host can replace (docs/storage.md). A native app’s document is at about:blank with the app’s origin, https://<app>.app.niso, so its storage is per app.

The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).

Feature On the web In niso Members
localStorage and sessionStorage Widely available Partial 95% 1239 of 1291 subtests pass 7
attribute
readonly attribute unsigned long length;
int32_t niso_storage_get_length(niso_dom* dom, niso_handle self, uint32_t* out);
operation
DOMString? key(unsigned long index);
int32_t niso_storage_key(niso_dom* dom, niso_handle self, uint32_t index, niso_str* out);
operation
DOMString? getItem(DOMString key);
int32_t niso_storage_get_item(niso_dom* dom, niso_handle self, const char* key, size_t key_len, niso_str* out);
operation
undefined setItem(DOMString key, DOMString value);
int32_t niso_storage_set_item(niso_dom* dom, niso_handle self, const char* key, size_t key_len, const char* value, size_t value_len);
operation
undefined removeItem(DOMString key);
int32_t niso_storage_remove_item(niso_dom* dom, niso_handle self, const char* key, size_t key_len);
operation
undefined clear();
int32_t niso_storage_clear(niso_dom* dom, niso_handle self);
operation
getter DOMString? (DOMString key);
operation
setter undefined (DOMString key, DOMString value);
operation
deleter undefined (DOMString key);