Checks whether running on a mobile device according to browser data

Use in your code Learn more
bit import tomlandau.simple-js/global/is-mobile

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 userAgentPass
isMobile .Android should return false for non Android userAgentPass
isMobile .BlackBerry should return true for BlackBerry userAgentPass
isMobile .BlackBerry should return false for non BlackBerry userAgentPass
isMobile .iPhone should return true for iPhone userAgentPass
isMobile .iPhone should return false for non iPhone userAgentPass
isMobile .iPod should return true for iPod userAgentPass
isMobile .iPod should return false for non iPod userAgentPass
isMobile .iPad should return true for iPad userAgentPass
isMobile .iPad should return false for non iPad userAgentPass
isMobile .iOS should return true for iPhone userAgentPass
isMobile .iOS should return true for iPad userAgentPass
isMobile .iOS should return true for iPod userAgentPass
isMobile .iOS should return false for non iOS userAgentPass
isMobile .Opera should return true for Opera userAgentPass
isMobile .Opera should return false for non Opera userAgentPass
isMobile .Windows should return true for Windows userAgentPass
isMobile .Windows should return false for non Windows userAgentPass
isMobile .KindleFire should return true for KindleFire userAgentPass
isMobile .KindleFire should return false for non KindleFire userAgentPass
isMobile .any should return true for any mobile userAgentPass
isMobile .any should return false for desktop userAgentPass