Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect mobile safari browser in ios 7?

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/)
like image 587
George Filippakos Avatar asked Sep 22 '13 13:09

George Filippakos


People also ask

Why is Safari not working on my iPhone 7?

When Safari is not working, the first thing you need to do is to check the network for Safari is available or not. Go to “Settings” > “Cellular” > “Safari” > choose “WLAN & Cellular Data”. If there is no problem with network settings for Safari, but it still doesn't work, go on to try tips below.


2 Answers

Try this (to detect iPod touch as well):

navigator.userAgent.match(/(iPad|iPhone|iPod touch);.*CPU.*OS 7_\d/i)
like image 149
Ehsan Tavakoli Avatar answered Sep 22 '22 21:09

Ehsan Tavakoli


Try this

navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i)
like image 39
Barry Avatar answered Sep 22 '22 21:09

Barry