Expand description
WebStorage — localStorage / 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 }:
| Method | CDP command |
|---|---|
WebStorage::get | DOMStorage.getDOMStorageItems (client-side filter) |
WebStorage::set | DOMStorage.setDOMStorageItem |
WebStorage::remove | DOMStorage.removeDOMStorageItem |
WebStorage::clear | DOMStorage.clear |
WebStorage::keys | DOMStorage.getDOMStorageItems |
WebStorage::size | DOMStorage.getDOMStorageItems |
WebStorage::has | DOMStorage.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 (
localStorageorsessionStorage) for a given origin.