Class BrowserInfo

java.lang.Object
com.vaadin.client.BrowserInfo

public class BrowserInfo extends Object
Provides a way to query information about web browser. Browser details are detected only once and those are stored in this singleton class.
Since:
1.0
  • Field Summary

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

    Modifier and Type
    Method
    Description
    get()
    Singleton method to get BrowserInfo object.
    int
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    int
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    float
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    float
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString() and check version against known issues.
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
    boolean
    Checks if the browser runs on a touch capable device.
    boolean
    Deprecated.
    use a parsing library like ua-parser-js to parse the user agent from getBrowserString()

    Methods inherited from class java.lang.Object

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

  • Method Details

    • get

      public static BrowserInfo get()
      Singleton method to get BrowserInfo object.
      Returns:
      instance of BrowserInfo object
    • isIE

      @Deprecated public boolean isIE()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is IE.
      Returns:
      true if the browser is IE, false otherwise
    • isEdge

      @Deprecated public boolean isEdge()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is Edge.
      Returns:
      true if the browser is Edge, false otherwise
    • isFirefox

      @Deprecated public boolean isFirefox()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is Firefox.
      Returns:
      true if the browser is Firefox, false otherwise
    • isSafari

      @Deprecated public boolean isSafari()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is Safari.
      Returns:
      true if the browser is Safari, false otherwise
    • isSafariOrIOS

      @Deprecated public boolean isSafariOrIOS()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is Safari or runs on IOS (covering also Chrome on iOS).
      Returns:
      true if the browser is Safari or running on IOS, false otherwise
    • isChrome

      @Deprecated public boolean isChrome()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is Chrome.
      Returns:
      true if the browser is Chrome, false otherwise
    • isGecko

      @Deprecated public boolean isGecko()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser using the Gecko engine.
      Returns:
      true if the browser is using Gecko, false otherwise
    • isWebkit

      @Deprecated public boolean isWebkit()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser using the Webkit engine.
      Returns:
      true if the browser is using Webkit, false otherwise
    • getGeckoVersion

      @Deprecated public float getGeckoVersion()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Returns the Gecko version if the browser is Gecko based. The Gecko version for Firefox 2 is 1.8 and 1.9 for Firefox 3.
      Returns:
      The Gecko version or -1 if the browser is not Gecko based
    • getWebkitVersion

      @Deprecated public float getWebkitVersion()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Returns the WebKit version if the browser is WebKit based. The WebKit version returned is the major version e.g., 523.
      Returns:
      The WebKit version or -1 if the browser is not WebKit based
    • isOpera

      @Deprecated public boolean isOpera()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is Opera.
      Returns:
      true if the browser is Opera, false otherwise
    • isTouchDevice

      public boolean isTouchDevice()
      Checks if the browser runs on a touch capable device.
      Returns:
      true if the browser runs on a touch based device, false otherwise
    • isAndroid

      @Deprecated public boolean isAndroid()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Checks if the browser is run on Android.
      Returns:
      true if the browser is run on Android, false otherwise
    • isAndroidWithBrokenScrollTop

      @Deprecated public boolean isAndroidWithBrokenScrollTop()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString() and check version against known issues.
      Tests if this is an Android devices with a broken scrollTop implementation.
      Returns:
      true if scrollTop cannot be trusted on this device, false otherwise
    • getBrowserMajorVersion

      @Deprecated public int getBrowserMajorVersion()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Returns the browser major version e.g., 3 for Firefox 3.5, 4 for Chrome 4, 8 for Internet Explorer 8.

      Note that Internet Explorer 8 and newer will return the document mode so IE8 rendering as IE7 will return 7.

      Returns:
      The major version of the browser.
    • getBrowserMinorVersion

      @Deprecated public int getBrowserMinorVersion()
      Deprecated.
      use a parsing library like ua-parser-js to parse the user agent from getBrowserString()
      Returns the browser minor version e.g., 5 for Firefox 3.5.
      Returns:
      The minor version of the browser, or -1 if not known/parsed.
      See Also: