Interface WebStorage.WebStorageJs

All Superinterfaces:
Serializable
Enclosing interface:
WebStorage

@JsDefinition public static interface WebStorage.WebStorageJs extends Serializable
What web storage asks of the browser, as a JavaScript definition for Page.executeJs(Class).

Which storage is worked on is a parameter rather than a declaration of its own, so the bundle carries one function per operation.

Since:
25.4
  • Method Details

    • setItem

      @JsExpression("window[$0].setItem($1,$2)") void setItem(String storage, String key, String value)
      Writes a value.
      Parameters:
      storage - the name of the storage on the window
      key - the key to write under
      value - the value to write
    • removeItem

      @JsExpression("window[$0].removeItem($1)") void removeItem(String storage, String key)
      Removes the value of a key.
      Parameters:
      storage - the name of the storage on the window
      key - the key to remove
    • clear

      @JsExpression("window[$0].clear()") void clear(String storage)
      Removes every value of a storage.
      Parameters:
      storage - the name of the storage on the window
    • getItem

      @JsExpression("return window[$0].getItem($1);") PendingJavaScriptResult getItem(String storage, String key)
      Reads the value of a key.
      Parameters:
      storage - the name of the storage on the window
      key - the key to read
      Returns:
      the pending result, which answers with the value or with null when the key has none