Created
May 10, 2016 18:54
-
-
Save himynameisdave/8eaa19f61938e168f7f0e603cdf06871 to your computer and use it in GitHub Desktop.
UA Sniffing for MobileSafari - I did not write this
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
| module.exports = function isMobileSafari() { | |
| return /(iPhone|iPod|iPad).+AppleWebKit/i.test(window.navigator.userAgent) && (function() { | |
| var iOSversion = window.navigator.userAgent.match(/OS (\d)/); | |
| return iOSversion && iOSversion.length>1 && parseInt(iOSversion[1]) < 10; | |
| })(); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_\d/i)