Mayank Tripathi Mayank Tripathi - 1 year ago 82
iOS Question

Detect if the user is navigating through the safari mobile browser on iphone

I am trying to detect if the user is navigating my website from safari browser on the iphone using jquery / javascript.

I am able to detect the IOS Environment using the user agent string


But this detects the Apple Webkit Environment i.e. it is same for all the browsers on the device. Can anyone suggest any different approach.

Answer Source


Try this, for detecting Safari browser in an iPhone:

var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);

It identifies Safari 3.0+ and distinguishes it from Chrome.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download