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 ie
Boolean true
if the current browser is internet explorer (any)ie6
Boolean true
if the current browser is internet explorer 6ie7
Boolean true
if the current browser is internet explorer 7firefox
Boolean true
if the current browser is Mozilla/Geckochrome
Boolean true
if the current browser is Chrome/Chrommiumsafari
Boolean true
if the current browser is Safari/Konqueroropera
Boolean true
if the current browser is Safari/Konquerorwebkit
Boolean true
if the current browser is operaname
String The name of the engine (e.g "chrome")
version
Number The version of the engine (e.g 31)
fullVersion
String 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 mac
Boolean true
if the platform is macwindows
Boolean true
if the platform is windowslinux
Boolean true
if the platform is linuxwebos
Boolean true
if the platform is webosios
Boolean true
if the platform is ios (ipod/iphone/ipad)blackberry
Boolean true
if the platform is blackberryandroid
Boolean true
if the platform is androidipad
Boolean true
if the platform is ipadtablet
Boolean true
if the platform is tabletother
Boolean true
if the platform is neither mac, windows or linuxname
String 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 window
Boolean true
if support window globaldocument
Boolean true
if support document globalnavigator
Boolean true
if support navigator globalxpath
Boolean true
if support xpathjson
Boolean true
if support Native JSONorientation
Boolean true
if support orientation eventsquerySelector
Boolean true
if support querySelectorfullscreen
Boolean true
if support the fullscreen APIinputPlaceholder
Boolean true
if input elements supports placeholderstouchEvents
Boolean true
if support touch eventspointerEvents
Boolean true
if support pointer eventsmutationEvents
Boolean true
if support DOM MutationEventseventCapture
Boolean true
if support event capturetransitionsCSS
Boolean true
if support CSS3 TransitionsopacityCSS
Boolean true
if support CSS opacity propertyflexboxCSS
Boolean true
if support CSS Flexbox layout (last specification)filterCSS
Boolean true
if support CSS MsFilter or CSS3 filter propertymatrixCSS
Boolean true
if support WebKitCSSMatrixstickyCSS
Boolean true
if support position stickydragAndDrop
Boolean true
if support mousemove/mousedown/mouseup -
<static> UWA.Utils.Client.Locale :Object
-
Stores Platform/Engine language, locale and dir infos.
Type
- Object
Properties:
Name Type Description lang
String Language value (e.g.
fr_FR
)locale
String Locale value (e.g.
fr
)dir
String Language direction
rtl
orltr
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 object
Object Where to search for the property
template
String 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.
returnName
Boolean 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 onLine
Boolean New value
timeout
String New value expiration
Returns
true
if 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 url
String Url to Rate/Bookmark/Save
title
String Name of Bookmark