detect-os
v0.0.2arrow_drop_downGets whether running on a certain operating system according to browser data. Functions to test for a certain operating system (each returns bool):
- isAndroid
- isBlackBerry
- isIos
- isMac
- isWindows
- isLinux
Function to get the operating system by name:
- get (possible return values: iOS, Android, Windows, Linux, Mac, BlackBerry, Unknown)
detectOs .isAndroid should return true for Android userAgent even though platform is Linux | Pass |
detectOs .isAndroid should return false for non Android userAgent | Pass |
detectOs .isBlackBerry should return true for BlackBerry platform | Pass |
detectOs .isBlackBerry should return false for non BlackBerry userAgent | Pass |
detectOs .isIos should return true for iPhone platform | Pass |
detectOs .isIos should return true for iPad platform | Pass |
detectOs .isIos should return true for iPod platform | Pass |
detectOs .isIos should return false for non iOS platform | Pass |
detectOs .isMac should return true for Macintosh platform | Pass |
detectOs .isMac should return true for MacIntel platform | Pass |
detectOs .isMac should return true for MacPPC platform | Pass |
detectOs .isMac should return true for Mac68K platform | Pass |
detectOs .isMac should return false for non-mac platform | Pass |
detectOs .isWindows should return true for Windows platform | Pass |
detectOs .isWindows should return true for Win16 platform | Pass |
detectOs .isWindows should return true for Win32 platform | Pass |
detectOs .isWindows should return true for WinCE platform | Pass |
detectOs .isWindows should return false for non-Windows platform | Pass |
detectOs .isLinux should return true for Linux platform | Pass |
detectOs .isLinux should return true for Linux aarch64 platform | Pass |
detectOs .isLinux should return true for Linux armv5tejl platform | Pass |
detectOs .isLinux should return true for Linux armv6l platform | Pass |
detectOs .isLinux should return true for Linux armv7l platform | Pass |
detectOs .isLinux should return true for Linux i686 on x86_64 platform | Pass |
detectOs .isLinux should return true for Linux i686 X11 platform | Pass |
detectOs .isLinux should return true for Linux ppc64 platform | Pass |
detectOs .isLinux should return true for Linux x86_64 platform | Pass |
detectOs .isLinux should return true for Linux x86_64 X11 platform | Pass |
detectOs .isLinux should return false for Linux platform when user agent is Android | Pass |
detectOs .isLinux should return false for non-Linux platform | Pass |
detectOs .get should return Linux when os is Linux | Pass |
detectOs .get should return Windows when os is Windows | Pass |
detectOs .get should return Mac when os is Mac | Pass |
detectOs .get should return iOS when os is iOS | Pass |
detectOs .get should return Android when os is Android | Pass |
detectOs .get should return BlackBerry when os is BlackBerry | Pass |
detectOs .get should return Unknown for other os | Pass |