Package com.vaadin.flow.component.page
Interface Page.PageJs
- All Superinterfaces:
Serializable
- Enclosing class:
Page
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 Summary
Modifier and TypeMethodDescriptiongetHref()The address the browser is at.Reads the direction the document is read in.voidreload()Loads the page again.voidLets the document follow the color scheme the user asked the browser for.voidsetColorScheme(String theme, String colorScheme) Pins the document to a color scheme.
-
Method Details
-
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 documentcolorScheme- the color scheme to set on the document
-
reload
Loads the page again. -
readDirection
Reads the direction the document is read in.- Returns:
- the pending direction
-