API Documentation

for 0.0.1
Show:

Device Class

Device class gives easy access to some device information such as the operating system and browser used

Item Index

Methods

Methods

getBrowser

() String static

Get the name of the web browser

Returns:

String:

The browser's name

getBrowserMajorVersion

() Number static

Get the major version number of the web browser

Returns:

Number:

The browser's major version

getBrowserVersion

() String static

Get the version of the web browser

Returns:

String:

The browser's version

getFramework

() String static

Get the framework the html page is running under (ejecta or cordova), if any

Returns:

String:

The framework's name, or null if none

getOS

() String static

Get the operating system's type

Returns:

String:

The OS type (Windows, Mac OS X, Android, iOS, etc)

getOSVersion

() String static

Get the operating system's version

Returns:

String:

The OS version

getScreenHeight

() Number static

Get the screen's height This does not necessarily indicate the height available Some of the screen's height might be used by browser widgets and scrollbars

Returns:

Number:

The screen's height in pixels

getScreenSize

() Object static

Returns:

Object:

An object with "width" and "height" as keys representing the screen's dimensions

getScreenWidth

() Number static

Get the screen's width This does not necessarily indicate the width available Some of the screen's width might be used by browser widgets and scrollbars

Returns:

Number:

The screen's width in pixels

getType

() String static

Get the device type

Returns:

String:

The device type (mobile or desktop)

Log

(
  • message
  • type
  • label
)
static

Log a message into the console or redirect it to the provided label if Mobilizing.debug === true

Parameters:

  • message String
  • type String
  • label Label

parseBrowserData

() private static

Parse browser data from navigator.appName, navigator.userAgent and navigator.appVersion Credit goes to http://stackoverflow.com/questions/9514179/how-to-find-the-operating-system-version-using-javascript

parseOSData

() private static

Parse OS data from navigator.userAgent and navigator.appVersion Credit goes to http://stackoverflow.com/questions/9514179/how-to-find-the-operating-system-version-using-javascript