Package io.jmix.flowui.util
Class WebBrowserTools
java.lang.Object
io.jmix.flowui.util.WebBrowserTools
Utility class for web browser related functionality.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.vaadin.flow.component.page.PendingJavaScriptResult
allowBrowserTabClosing
(com.vaadin.flow.component.UI ui) Removes window's beforeunload event listener that prevents browser tab closing.static com.vaadin.flow.component.page.PendingJavaScriptResult
allowBrowserTabClosing
(View<?> view) Removes window's beforeunload event listener that prevents browser tab closing.static com.vaadin.flow.component.page.PendingJavaScriptResult
preventBrowserTabClosing
(com.vaadin.flow.component.UI ui) Subscribes on window's beforeunload event to prevent browser tab closing.static com.vaadin.flow.component.page.PendingJavaScriptResult
preventBrowserTabClosing
(View<?> view) Subscribes on window's beforeunload event to prevent browser tab closing.
-
Field Details
-
BEFORE_UNLOAD_LISTENER
- See Also:
-
-
Method Details
-
preventBrowserTabClosing
public static com.vaadin.flow.component.page.PendingJavaScriptResult preventBrowserTabClosing(View<?> view) Subscribes on window's beforeunload event to prevent browser tab closing.- Parameters:
view
- a view that calls JavaScript function- Returns:
- a pending result from a JavaScript snippet sent to the browser for evaluation.
-
allowBrowserTabClosing
public static com.vaadin.flow.component.page.PendingJavaScriptResult allowBrowserTabClosing(View<?> view) Removes window's beforeunload event listener that prevents browser tab closing.- Parameters:
view
- a view that calls JavaScript function- Returns:
- a pending result from a JavaScript snippet sent to the browser for evaluation.
-
preventBrowserTabClosing
public static com.vaadin.flow.component.page.PendingJavaScriptResult preventBrowserTabClosing(com.vaadin.flow.component.UI ui) Subscribes on window's beforeunload event to prevent browser tab closing.- Parameters:
ui
- ui object that calls JavaScript function- Returns:
- a pending result from a JavaScript snippet sent to the browser for evaluation.
-
allowBrowserTabClosing
public static com.vaadin.flow.component.page.PendingJavaScriptResult allowBrowserTabClosing(com.vaadin.flow.component.UI ui) Removes window's beforeunload event listener that prevents browser tab closing.- Parameters:
ui
- ui object that calls JavaScript function- Returns:
- a pending result from a JavaScript snippet sent to the browser for evaluation.
-