Class WebBrowserTools

java.lang.Object
io.jmix.flowui.util.WebBrowserTools

public final class WebBrowserTools extends Object
Utility class for web browser related functionality.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static com.vaadin.flow.component.page.PendingJavaScriptResult
    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
    Subscribes on window's beforeunload event to prevent browser tab closing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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.