Created
June 17, 2019 03:40
-
-
Save kevinn/6fb2325154a1f50297357762b5f8ebe0 to your computer and use it in GitHub Desktop.
Mobile User Agent check Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// As always, user-agent detection is not recommended. | |
// Caveats apply, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent | |
mobileCheck: function() { | |
return /Mobi|Android/i.test(navigator.userAgent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment