Created
October 24, 2011 21:53
-
-
Save donut/1310438 to your computer and use it in GitHub Desktop.
UA sniffing for touch-based browsers.
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
// Is this a touch-based device? | |
window.navigator.isTouchDevice = | |
( window.navigator.userAgent && | |
window.navigator.userAgent.search( | |
/iPod|iPad|iPhone|IEMobile|BlackBerry|webOS|Android|Fennec/i | |
) !== -1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment