Helpers for handling mobile devices
npm install mobile-device-detectHelpers for handling mobile devices in javascript.
To install, you can use npm or yarn:
``
npm install mobile-device-detect --save
or
yarn add mobile-device-detect
`
Import any helper to your component, for example, in Vue.js:
`html
`
pass it to template:
`html`
{{ msg }}
For react example, you can look into separated package react-device-detect
| Property | Return type | Description |
| ------------------ | -------- | -------------------------------------------------------------------------------------- |
| isMobile | bool | returns true if device type is mobile or tablet |mobile
| isMobileOnly | bool | returns true if device type is |tablet
| isTablet | bool | returns true if device type is |browser
| isBrowser | bool | returns true if device type is |smarttv
| isSmartTV | bool | returns true if device type is |wearable
| isWearable | bool | returns true if device type is |console
| isConsole | bool | returns true if device type is |Android
| isAndroid | bool | returns true if os type is |Windows Phone
| isWinPhone | bool | returns true if os type is |iOS
| isIOS | bool | returns true if os type is |Chrome
| isChrome | bool | returns true if browser is |Firefox
| isFirefox | bool | returns true if browser is |Safari
| isSafari | bool | returns true if browser is |Opera
| isOpera | bool | returns true if browser is |Internet Explorer
| isIE | bool | returns true if browser is |Edge
| isEdge | bool | returns true if browser is or Edge Chromium |Yandex
| isYandex | bool | returns true if browser is |Chromium
| isChromium | bool | returns true if browser is |Mobile Safari
| isMobileSafari | bool | returns true if browser is |Windows
| osVersion | string | returns os version (e.g 7 for or 6 for Android) |Windows
| osName | string | returns os name (e.g , Android) |Chrome
| fullBrowserVersion | string | returns full browser version (e.g 65.0.3325.181 for ) |major
| browserVersion | string | returns browser version (e.g 65 in Chrome or 9 in IE) |LG
| browserName | string | returns browser name |
| mobileVendor | string | returns mobile device vendor (e.g , iPhone etc) |Nexus 5
| mobileModel | string | returns mobile device model (e.g ) |name
| engineName | string | returns browser engine (e.g Gecko for FF or WebKit for Chrome) |mobile
| engineVersion | string | returns engine version |
| getUA | string | returns user agent |
| deviceType | string | returns device type (e.g or tablet) |Electron
| isIOS13 | boolean | returns true/false if device is running on iOS13 |
| isIPhone13 | boolean | returns true/false if device is iPhone and running on iOS13 |
| isIPad13 | boolean | returns true/false if device is iPad and running on iOS13 |
| isIPod13 | boolean | returns true/false if device is iPod and running on iOS13 |
| isElectron | boolean | returns true/false if running on |Edge Chromium
| isEdgeChromium | boolean | returns true/false if browser is | Edge
| isLegacyEdge | boolean | returns true if browser is |Windows
| isWindows | boolean | returns true/false if os is |Mac OS` |
| isMacOs | boolean | returns true/false if os is
| deviceDetect | function | return data object which includes all data about device (e.g version, engine, os etc.) |
MIT