localDevice Object ReferenceThe localDevice object provides properties about the platform that the app is executing on.
localDevicelocalDevice is a global variable (var localDevice) defined by a classic script loaded with a <script> tag. It is not exported from a module and needs no import.
localDevice propertiesisAndroidTrue if the app is running on an Android device.
A Boolean.
isIOSTrue if the app is running on an Apple iOS device (iPhone or iPad).
A Boolean.
isLocalhostTrue if the app is running in a browser from local (localhost) server.
A Boolean.
isNativeTrue if the app is running in any Cordova host (window.cordova exists), i.e. as a native app.
A Boolean.
isTouchTrue if the device is touch capable (ontouchstart is supported or the user agent contains Touch). This includes any touch-capable device, not only mobile devices.
A Boolean.
isWebAppTrue if the app is running as a standalone home-screen web app (navigator.standalone) and is not native.
A Boolean.
missingA string containing important missing features in the app environment, determined from Modernizr tests. The features are separated by '+'. The possible features are:
es6es6 indicates that some important JavaScipt ES6 (ES2015) features, or fetch, are missing. ES6 is a required capability.fetchfetch indicates that the fetch function or URL parsing is missing. fetch is a required capability.speechRecspeechRec indicates that the speech recognition is missing.speechSynspeechSyn indicates that the speech synthesis is missing.svcWkrsvcWkr indicates that the Service Workers are missing.A string.
platformA string indicating the current platform. The possible strings are:
AndroiddesktopiPadiPhoneA string.
stringsAn object of descriptive strings, derived with UAParser, for diagnostics:
platformplatform and whether this is an app or browser.deviceunknown.osbrowserAn object of strings.
viewHeight()Returns the viewport height in pixels in the current orientation: the larger of document.documentElement.clientHeight and window.innerHeight.
A number.
viewWidth()Returns the viewport width in pixels in the current orientation: the larger of document.documentElement.clientWidth and window.innerWidth.
A number.
portHeight()Returns the viewport height in portrait orientation: the larger of viewWidth() and viewHeight().
A number.
portWidth()Returns the viewport width in portrait orientation: the smaller of viewWidth() and viewHeight().
A number.