Skip to main content

Module web_storage

Module web_storage 

Source
Expand description

WebStoragelocalStorage / sessionStorage access via the CDP DOMStorage domain.

A WebStorage is bound to a page session, a security origin, and a choice of local vs. session storage. All operations map directly onto CDP’s DOMStorage.* commands with a storageId of { securityOrigin, isLocalStorage }:

MethodCDP command
WebStorage::getDOMStorage.getDOMStorageItems (client-side filter)
WebStorage::setDOMStorage.setDOMStorageItem
WebStorage::removeDOMStorage.removeDOMStorageItem
WebStorage::clearDOMStorage.clear
WebStorage::keysDOMStorage.getDOMStorageItems
WebStorage::sizeDOMStorage.getDOMStorageItems
WebStorage::hasDOMStorage.getDOMStorageItems (client-side filter)

Mirrors the shape of Playwright’s page.evaluate-backed storage helpers, but talks CDP directly.

Structs§

WebStorage
A handle to one of a page’s web storages (localStorage or sessionStorage) for a given origin.