WebStorage

Playwright\WebStorage\WebStorageInterface

Reads and writes the storage of the page's current origin. Every method throws when the page sits on an origin that has no storage, such as about:blank or a data: URL.

Methods

clear()

void

Removes every item, leaving the other storage of the same origin untouched.

function clear(): void

getItem()

?string

Returns null when nothing is stored under that name.

function getItem(string $name): ?string

items()

array

Returns every item, in the order the browser reports them.

function items(): array

removeItem()

void

Does nothing when no item is stored under that name.

function removeItem(string $name): void

setItem()

void

Overwrites any value already stored under that name.

function setItem(string $name, string $value): void