This tutorial explains some of the utility methods and objects inside the
Liferay
global JavaScript object.
Liferay Browser
The Liferay.Browser
object contains methods that expose the current user agent
characteristics without the need of accessing and parsing the global
window.navigator
object.
The available methods for the Liferay.Browser
object are listed in the table
below:
Method | Return Type | Description |
---|---|---|
acceptsGzip | boolean | Returns whether the browser accepts gzip file compression |
getMajorVersion | number | Returns the major version of the browser |
getRevision | number | Returns the revision version of the browser |
getVersion | number | Returns the major.minor version of the browser |
isAir | boolean | Returns whether the browser is Adobe AIR |
isChrome | boolean | Returns whether the browser is Chrome |
isFirefox | boolean | Returns whether the browser is Firefox |
isGecko | boolean | Returns whether the browser is Gecko |
isIe | boolean | Returns whether the browser is Internet Explorer |
isIphone | boolean | Returns whether the browser is on an Iphone |
isLinux | boolean | Returns whether the browser is being viewed on Linux |
isMac | boolean | Returns whether the browser is being viewed on Mac |
isMobile | boolean | Returns whether the browser is being viewed on a mobile device |
isMozilla | boolean | Returns whether the browser is Mozilla |
isOpera | boolean | Returns whether the browser is Opera |
isRtf | boolean | Returns whether the browser supports RTF |
isSafari | boolean | Returns whether the browser is Safari |
isSun | boolean | Returns whether the browser is being viewed on Sun OS |
isWebKit | boolean | Returns whether the browser is WebKit |
isWindows | boolean | Returns whether the browser is being viewed on Windows |