Enum Class WebShareSupport

java.lang.Object
java.lang.Enum<WebShareSupport>
com.vaadin.flow.component.page.WebShareSupport
All Implemented Interfaces:
Serializable, Comparable<WebShareSupport>, Constable

public enum WebShareSupport extends Enum<WebShareSupport>
Whether the browser exposes the Web Share API (navigator.share).

Held by Page.shareSupportSignal(). Reading the value does not show any browser dialog — it reports whether a subsequent Page.share(String, String, String) call would succeed in invoking the native share sheet, or whether it would fail because the API is missing in the current browser context.

Typical usage:

  • Enum Constant Details

    • UNKNOWN

      public static final WebShareSupport UNKNOWN
      No value has been reported by the browser yet. Used only as the initial value of the signal before the first client handshake delivers the real one. In normal request handling the signal is seeded before any user code (UI initialization, UIInitListener, component attach) runs, so this value is essentially never observed in practice; once a real value has arrived, the signal never returns to UNKNOWN.
    • SUPPORTED

      public static final WebShareSupport SUPPORTED
      The browser exposes navigator.share; calls to Page.share(String, String, String) will invoke the native share sheet.
    • UNSUPPORTED

      public static final WebShareSupport UNSUPPORTED
      The browser does not expose navigator.share; calls to Page.share(String, String, String) will throw UnsupportedOperationException. Some desktop browsers, in particular older Firefox versions, fall in this bucket.
  • Method Details

    • values

      public static WebShareSupport[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WebShareSupport valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null