GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Playwright for Java
  • Docs
  • API
  • Java
  • Node.js
  • Python
  • .NET
  • Community
  • Classes
  • APIRequestContext
  • APIResponse
  • Browser
  • BrowserContext
  • BrowserType

This view

  • Original page
  • New address

GeezerVison is showing playwright.dev — WebStorage | Playwright Java

WebStorage exposes the page's localStorage or sessionStorage for the current origin via an async, browser-consistent API.

Instances are accessed through Page.localStorage() and Page.sessionStorage().

page.navigate("https://example.com");
page.localStorage().setItem("token", "abc");
String token = page.localStorage().getItem("token");
List<WebStorageItem> all = page.localStorage().items();
page.localStorage().removeItem("token");
page.localStorage().clear();

Methods​

clear​

Added in: v1.61 webStorage.clear

Removes all items from the storage.

Usage

WebStorage.clear();

Returns

  • void#

getItem​

Added in: v1.61 webStorage.getItem

Returns the value for the given name if present.

Usage

WebStorage.getItem(name);

Arguments

  • name String#

    Name of the item to retrieve.

Returns

  • null | String#

items​

Added in: v1.61 webStorage.items

Returns all items in the storage as name/value pairs.

Usage

WebStorage.items();

Returns

  • List<Items>#
    • name String

    • value String


removeItem​

Added in: v1.61 webStorage.removeItem

Removes the item with the given name. No-op if the item is absent.

Usage

WebStorage.removeItem(name);

Arguments

  • name String#

    Name of the item to remove.

Returns

  • void#

setItem​

Added in: v1.61 webStorage.setItem

Sets the value for the given name. Overwrites any existing value for that name.

Usage

WebStorage.setItem(name, value);

Arguments

  • name String#

    Name of the item to set.

  • value String#

    New value for the item.

Returns

  • void#
  • Methods
    • clear
    • getItem
    • items
    • removeItem
    • setItem
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.