How to detect mobile safari browser in ios 7?
Asked Answered
G

3

13

What is the official method to detect mobile safari on ios7?

For example:

 navigator.userAgent.match(/(iPod|iPhone|iPad)/) 
 && navigator.userAgent.match(/AppleWebKit/) 
 && navigator.userAgent.match(/OS 7/)
Gourley answered 22/9, 2013 at 13:2 Comment(0)
T
22

Try this (to detect iPod touch as well):

navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_\d/i)
Target answered 21/10, 2013 at 0:42 Comment(0)
P
4

Try this

navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i)
Parent answered 25/9, 2013 at 3:36 Comment(0)
P
0
/iP(ad|hone|od)/.test(navigator.userAgent)

Gives simple T/F.

Parathion answered 2/9, 2014 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.