Mayank Tripathi Mayank Tripathi - 1 month ago 8
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.



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.