is-mobile

v0.0.2arrow_drop_down
v0.0.2
v0.0.1
STATUS
Passing
DOWNLOADS
14
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
2 years ago
subject
# Checks whether running on a mobile device according to browser data
1 contributor
Like
Use is-mobile in your project ?
Copied
npm i @bit/tomlandau.simple-js.global.is-mobile
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
isMobile.Android() => true/false isMobile.iOS() => true/false isMobile.any() => true/false isMobile.KindleFire() => true/false isMobile.BlackBerry() => true/false
modified
chevron_left
chevron_right
global/isMobile ()

Checks whether running on a mobile device according to browser data.

Functions (each returns bool):

  • Android
  • BlackBerry
  • iPhone
  • iPod
  • iPad
  • iOS
  • Opera
  • Windows
  • Kindle Fire
  • any
Example
isMobile.Android() => true/false
isMobile.iOS() => true/false
isMobile.any() => true/false
isMobile.KindleFire() => true/false
isMobile.BlackBerry() => true/false
Test Summary

isMobile .Android should return true for Android userAgent

Pass

isMobile .Android should return false for non Android userAgent

Pass

isMobile .BlackBerry should return true for BlackBerry userAgent

Pass

isMobile .BlackBerry should return false for non BlackBerry userAgent

Pass

isMobile .iPhone should return true for iPhone userAgent

Pass

isMobile .iPhone should return false for non iPhone userAgent

Pass

isMobile .iPod should return true for iPod userAgent

Pass

isMobile .iPod should return false for non iPod userAgent

Pass

isMobile .iPad should return true for iPad userAgent

Pass

isMobile .iPad should return false for non iPad userAgent

Pass

isMobile .iOS should return true for iPhone userAgent

Pass

isMobile .iOS should return true for iPad userAgent

Pass

isMobile .iOS should return true for iPod userAgent

Pass

isMobile .iOS should return false for non iOS userAgent

Pass

isMobile .Opera should return true for Opera userAgent

Pass

isMobile .Opera should return false for non Opera userAgent

Pass

isMobile .Windows should return true for Windows userAgent

Pass

isMobile .Windows should return false for non Windows userAgent

Pass

isMobile .KindleFire should return true for KindleFire userAgent

Pass

isMobile .KindleFire should return false for non KindleFire userAgent

Pass

isMobile .any should return true for any mobile userAgent

Pass

isMobile .any should return false for desktop userAgent

Pass