Enum Class WebShareSupport

java.lang.Object
java.lang.Enum<WebShareSupport>
com.vaadin.flow.component.webshare.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 WebShare.supportSignal(). Reading the value does not show any browser dialog ? it reports whether a subsequent share action would be able to invoke the native share sheet, or whether the call would silently no-op because the API is missing in the current browser context.

Typical usage:

  • SUPPORTED ? show a "Share" button that triggers a share action.
  • UNSUPPORTED ? fall back to a copy-link or social-network affordance; the native sheet is unavailable in this browser.
  • UNKNOWN ? only seen in the brief window before the first bootstrap handshake completes; treat the same as UNSUPPORTED until a real value arrives.
Since:
25.2
  • 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; share actions bound to a user gesture will invoke the native share sheet.
    • UNSUPPORTED

      public static final WebShareSupport UNSUPPORTED
      The browser does not expose navigator.share; share actions silently reject. Most desktop Firefox builds and older browsers 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