public class BrowserInfo extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ENGINE_GECKO |
static String |
ENGINE_PRESTO |
static String |
ENGINE_TRIDENT |
static String |
ENGINE_WEBKIT |
| Modifier and Type | Method and Description |
|---|---|
static BrowserInfo |
get()
Singleton method to get BrowserInfo object.
|
int |
getBrowserMajorVersion()
Returns the browser major version e.g., 3 for Firefox 3.5, 4 for Chrome
4, 8 for Internet Explorer 8.
|
int |
getBrowserMinorVersion()
Returns the browser minor version e.g., 5 for Firefox 3.5.
|
float |
getGeckoVersion()
Returns the Gecko version if the browser is Gecko based.
|
float |
getWebkitVersion()
Returns the WebKit version if the browser is WebKit based.
|
boolean |
isAndroid()
Checks if the browser is run on Android.
|
boolean |
isAndroidWithBrokenScrollTop()
Tests if this is an Android devices with a broken scrollTop
implementation.
|
boolean |
isChrome()
Checks if the browser is Chrome.
|
boolean |
isEdge()
Checks if the browser is Edge.
|
boolean |
isEs6Supported()
Checks if the browser supports ECMAScript 6, based on the user agent.
|
boolean |
isFirefox()
Checks if the browser is Firefox.
|
boolean |
isGecko()
Checks if the browser using the Gecko engine.
|
boolean |
isIE()
Checks if the browser is IE.
|
boolean |
isIOS()
Checks if the browser is run on iOS.
|
boolean |
isOpera()
Checks if the browser is Opera.
|
boolean |
isSafari()
Checks if the browser is Safari.
|
boolean |
isSafariOrIOS()
Checks if the browser is Safari or runs on IOS (covering also Chrome on
iOS).
|
boolean |
isTouchDevice()
Checks if the browser runs on a touch capable device.
|
boolean |
isWebkit()
Checks if the browser using the Webkit engine.
|
public static final String ENGINE_GECKO
public static final String ENGINE_WEBKIT
public static final String ENGINE_PRESTO
public static final String ENGINE_TRIDENT
public static BrowserInfo get()
public boolean isIE()
public boolean isEdge()
public boolean isFirefox()
public boolean isSafari()
public boolean isSafariOrIOS()
public boolean isChrome()
public boolean isGecko()
public boolean isWebkit()
public float getGeckoVersion()
public float getWebkitVersion()
public boolean isOpera()
public boolean isTouchDevice()
public boolean isIOS()
public boolean isAndroid()
public boolean isAndroidWithBrokenScrollTop()
public int getBrowserMajorVersion()
Note that Internet Explorer 8 and newer will return the document mode so IE8 rendering as IE7 will return 7.
public int getBrowserMinorVersion()
getBrowserMajorVersion()public boolean isEs6Supported()
true if the browser supports ES6, false
otherwise.BrowserDetails.isEs6Supported()Copyright © 2000–2022 Vaadin Ltd. All rights reserved.