public class BrowserDetails extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BrowserDetails.OperatingSystem
Detected operating systems.
|
Constructor and Description |
---|
BrowserDetails(String userAgent)
Create an instance based on the given user agent.
|
Modifier and Type | Method and Description |
---|---|
float |
getBrowserEngineVersion()
Returns the version of the browser engine.
|
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.
|
int |
getOperatingSystemMajorVersion()
Returns the major version of the operating system.
|
int |
getOperatingSystemMinorVersion()
Returns the minor version of the operating system.
|
boolean |
isAndroid()
Tests if the browser is run on Android.
|
boolean |
isChrome()
Tests if the browser is Chrome.
|
boolean |
isChromeOS()
Tests if the browser is run on Chrome OS (e.g.
|
boolean |
isEdge()
Tests if the browser is Edge.
|
boolean |
isEs5AdapterNeeded()
Checks if the browser needs `custom-elements-es5-adapter.js` to be
loaded.
|
boolean |
isEs6Supported()
Checks if the browser supports ECMAScript 6, based on the user agent.
|
boolean |
isFirefox()
Tests if the browser is Firefox.
|
boolean |
isGecko()
Tests if the browser is using the Gecko engine.
|
boolean |
isIE()
Tests if the browser is Internet Explorer.
|
boolean |
isIOS()
Tests if the browser is run in iOS.
|
boolean |
isIPad()
Tests if the browser is run on iPad.
|
boolean |
isIPhone()
Tests if the browser is run on iPhone.
|
boolean |
isLinux()
Tests if the browser is run on Linux.
|
boolean |
isMacOSX()
Tests if the browser is run on Mac OSX.
|
boolean |
isOpera()
Tests if the browser is Opera.
|
boolean |
isPresto()
Tests if the browser is using the Presto engine.
|
boolean |
isSafari()
Tests if the browser is Safari.
|
boolean |
isSafariOrIOS()
Tests if the browser is Safari or runs on IOS (covering also Chrome on
iOS).
|
boolean |
isTooOldToFunctionProperly()
Checks if the browser is so old that it simply won't work.
|
boolean |
isTrident()
Tests if the browser is using the Trident engine.
|
boolean |
isWebKit()
Tests if the browser is using the WebKit engine.
|
boolean |
isWindows()
Tests if the browser is run on Windows.
|
boolean |
isWindowsPhone()
Tests if the browser is run on Windows Phone.
|
public BrowserDetails(String userAgent)
userAgent
- User agent as provided by the browser.public boolean isFirefox()
public boolean isGecko()
public boolean isWebKit()
public boolean isPresto()
public boolean isTrident()
public boolean isSafari()
public boolean isSafariOrIOS()
public boolean isChrome()
public boolean isOpera()
public boolean isIE()
public boolean isEdge()
public float getBrowserEngineVersion()
public final int getBrowserMajorVersion()
Note that Internet Explorer 8 and newer will return the document mode so IE8 rendering as IE7 will return 7.
public final int getBrowserMinorVersion()
getBrowserMajorVersion()
public boolean isWindows()
public boolean isWindowsPhone()
public boolean isMacOSX()
public boolean isLinux()
public boolean isAndroid()
public boolean isIOS()
public boolean isIPhone()
public boolean isChromeOS()
public boolean isIPad()
public int getOperatingSystemMajorVersion()
public int getOperatingSystemMinorVersion()
public boolean isTooOldToFunctionProperly()
public boolean isEs6Supported()
true
if the browser supports ES6, false
otherwise.public boolean isEs5AdapterNeeded()
This adapter file is needed when the browser has some ES6 capabilities, but a ES5 files are served instead. This happens when the browser doesn't support all ES6 features needed for Flow to work properly, or when some ES6 features have bugs under conditions used by the application.
true
if the browser needs the adapter,
false
otherwise.Copyright © 2019. All rights reserved.