Interface Page.PageJs

All Superinterfaces:
Serializable
Enclosing class:
Page

@JsDefinition public static interface Page.PageJs extends Serializable
What this page asks of the browser, as a JavaScript definition for Page.executeJs(Class): the build collects it into the bundle, so none of it needs an expression and all of it works under a content security policy without unsafe-eval.
Since:
25.4
  • Method Details

    • getHref

      @JsExpression("return window.location.href") PendingJavaScriptResult getHref()
      The address the browser is at.
      Returns:
      the pending address
    • resetColorScheme

      @JsExpression("document.documentElement.removeAttribute(\'theme\');\ndocument.documentElement.style.colorScheme = \'\';\n") void resetColorScheme()
      Lets the document follow the color scheme the user asked the browser for.
    • setColorScheme

      @JsExpression("document.documentElement.setAttribute(\'theme\', $0);\ndocument.documentElement.style.colorScheme = $1;\n") void setColorScheme(String theme, String colorScheme)
      Pins the document to a color scheme.
      Parameters:
      theme - the theme to set on the document
      colorScheme - the color scheme to set on the document
    • reload

      @JsExpression("window.location.reload();") void reload()
      Loads the page again.
    • readDirection

      @JsExpression("return document.dir") PendingJavaScriptResult readDirection()
      Reads the direction the document is read in.
      Returns:
      the pending direction