Package com.vaadin.client
Class BrowserInfo
java.lang.Object
com.vaadin.client.BrowserInfo
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic BrowserInfoget()Singleton method to get BrowserInfo object.intDeprecated.intDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()floatDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()floatDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()and check version against known issues.booleanisChrome()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanisEdge()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanisGecko()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanisIE()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanisOpera()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanisSafari()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanDeprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()booleanChecks if the browser runs on a touch capable device.booleanisWebkit()Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()
-
Field Details
-
ENGINE_GECKO
- See Also:
-
ENGINE_WEBKIT
- See Also:
-
ENGINE_PRESTO
- See Also:
-
ENGINE_TRIDENT
- See Also:
-
-
Method Details
-
get
Singleton method to get BrowserInfo object.- Returns:
- instance of BrowserInfo object
-
isIE
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser is IE.- Returns:
- true if the browser is IE, false otherwise
-
isEdge
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser is Edge.- Returns:
- true if the browser is Edge, false otherwise
-
isFirefox
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser is Firefox.- Returns:
- true if the browser is Firefox, false otherwise
-
isSafari
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser is Safari.- Returns:
- true if the browser is Safari, false otherwise
-
isSafariOrIOS
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser is Chrome.- Returns:
- true if the browser is Chrome, false otherwise
-
isGecko
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser using the Gecko engine.- Returns:
- true if the browser is using Gecko, false otherwise
-
isWebkit
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser using the Webkit engine.- Returns:
- true if the browser is using Webkit, false otherwise
-
getGeckoVersion
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()Checks if the browser is run on Android.- Returns:
- true if the browser is run on Android, false otherwise
-
isAndroidWithBrokenScrollTop
Deprecated.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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.use a parsing library like ua-parser-js to parse the user agent fromgetBrowserString()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:
-
getBrowserString()