Created
May 2, 2016 21:48
-
-
Save chrisgoddard/a5bb338e7dcb96884ccd6efac35ccb13 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Simple regex/user agent mobile checker | |
* about 99% accurate when compared to 175k sessions in GA | |
*/ | |
function isMobile() | |
{ | |
return window.navigator.match(/Mobi|Touch|Opera\ Mini|Android/) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment