Cross-Platform API for Client (Browser, WebView) interaction and features detections.
Index
Members
Methods
Members
-
<static> UWA.Utils.Client.Engine :Object
-
Stores Engine infos.
Engine detection is entirely object-based.
Type
- Object
Properties:
Name Type Description ieBoolean trueif the current browser is internet explorer (any)ie6Boolean trueif the current browser is internet explorer 6ie7Boolean trueif the current browser is internet explorer 7firefoxBoolean trueif the current browser is Mozilla/GeckochromeBoolean trueif the current browser is Chrome/ChrommiumsafariBoolean trueif the current browser is Safari/KonqueroroperaBoolean trueif the current browser is Safari/KonquerorwebkitBoolean trueif the current browser is operanameString The name of the engine (e.g "chrome")
versionNumber The version of the engine (e.g 31)
fullVersionString The version of the engine (e.g "31.0.1650.48")
-
<static> UWA.Utils.Client.Platform :Object
-
Stores Platform infos.
Type
- Object
Properties:
Name Type Description macBoolean trueif the platform is macwindowsBoolean trueif the platform is windowslinuxBoolean trueif the platform is linuxwebosBoolean trueif the platform is webosiosBoolean trueif the platform is ios (ipod/iphone/ipad)blackberryBoolean trueif the platform is blackberryandroidBoolean trueif the platform is androidipadBoolean trueif the platform is ipadtabletBoolean trueif the platform is tabletotherBoolean trueif the platform is neither mac, windows or linuxnameString Is set to the name of the platform (e.g "linux")
-
<static> UWA.Utils.Client.Features :Object
-
Stores Platform/Engine extras features infos.
Detect Platform/Engine/DOM features support, like XHR and XPath for example.
Type
- Object
Properties:
Name Type Description windowBoolean trueif support window globaldocumentBoolean trueif support document globalnavigatorBoolean trueif support navigator globalxpathBoolean trueif support xpathjsonBoolean trueif support Native JSONorientationBoolean trueif support orientation eventsquerySelectorBoolean trueif support querySelectorfullscreenBoolean trueif support the fullscreen APIinputPlaceholderBoolean trueif input elements supports placeholderstouchEventsBoolean trueif support touch eventspointerEventsBoolean trueif support pointer eventsmutationEventsBoolean trueif support DOM MutationEventseventCaptureBoolean trueif support event capturetransitionsCSSBoolean trueif support CSS3 TransitionsopacityCSSBoolean trueif support CSS opacity propertyflexboxCSSBoolean trueif support CSS Flexbox layout (last specification)filterCSSBoolean trueif support CSS MsFilter or CSS3 filter propertymatrixCSSBoolean trueif support WebKitCSSMatrixstickyCSSBoolean trueif support position stickydragAndDropBoolean trueif support mousemove/mousedown/mouseup -
<static> UWA.Utils.Client.Locale :Object
-
Stores Platform/Engine language, locale and dir infos.
Type
- Object
Properties:
Name Type Description langString Language value (e.g.
fr_FR)localeString Locale value (e.g.
fr)dirString Language direction
rtlorltr
Methods
-
<static> UWA.Utils.Client.getOrientation() → {String}
-
Get Client viewport orientation.
Return "portrait" when screen resolution is greater horizontally than vertically, and "landscape" when screen resolution is greater vertically than horizontally.
Returns
"portrait" or "landscape".
- Type
- String
-
<static> UWA.Utils.Client.getScrollbarWidth() → {Number}
-
Obtain the native scrollbar width.
Returns
Native width of the scrollbar.
- Type
- Number
-
<static> UWA.Utils.Client.getVendorProperty(object, template, returnName) → {String|Object}
-
Helper to retrieve a prefixed vendor property.
For style names, please prefer Element#getStyleName Please cache the result of this function locally in order to improve performances
Example
var cancelAnimationFrame = UWA.Client.getVendorProperty(window, 'cancelAnimationFrame'); // Is the equivalent of: var cancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || // .... var eventName = UWA.Client.getVendorProperty(document.documentElement, 'on{}fullscreenchange');Parameters
Name Type Description objectObject Where to search for the property
templateString The base property name. Usually, it should be the standard property name. If this string contains "{}", the prefix will be inserted here instead of at the beginning.
returnNameBoolean If
true, returns the prefixed property name instead of the property value. Default tofalse.Returns
The property value, or its name if returnName is
true- Type
- String | Object
-
<static> UWA.Utils.Client.isOnline(onLine, timeout) → {Boolean}
-
Check if current Client is online or not.
Parameters
Name Type Description onLineBoolean New value
timeoutString New value expiration
Returns
trueif online elsefalse.- Type
- Boolean
-
<static> UWA.Utils.Client.getSize() → {Object}
-
Get viewport bounds (including page scrolling if any) of current window.
Returns
With "height" and "width" properties.
- Type
- Object
-
<static> UWA.Utils.Client.getScrolls() → {Object}
-
Obtain the scurrent crolling offsets in both the horizontal and vertical direction.
Returns
Object with "x" and "y" properties.
- Type
- Object
-
<static> UWA.Utils.Client.addStar(url, title)
-
Add Client Rating/Star/Favorite/...
Parameters
Name Type Description urlString Url to Rate/Bookmark/Save
titleString Name of Bookmark