Skip to content

Instantly share code, notes, and snippets.

@kevinn
Created June 17, 2019 03:40
Show Gist options
  • Save kevinn/6fb2325154a1f50297357762b5f8ebe0 to your computer and use it in GitHub Desktop.
Save kevinn/6fb2325154a1f50297357762b5f8ebe0 to your computer and use it in GitHub Desktop.
Mobile User Agent check Javascript
// 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