How to detect (from website) whether ipad is using a Safari or non Safari (wrapper) browser?

295 Views Asked by At

On the iPad (2+) The Chrome browser (which is a wrapper around the native Safari browser AFAIK) does not fire some events (such as when the user closes the browser). This leads to false positive "app has crashed" reporting.

So we'd like to filter out users who are using Safari from some sort of wrapper.

Is there any way to detect that (relatively easily)?

Stack: PhP, .JS, jQuery

1

There are 1 best solutions below

0
On

You can acces such information via the browser's User Agent (UA) string. Try and have a look at this: https://developer.chrome.com/multidevice/user-agent

According to that, the Safari users could be filtered out with:

if(navigator.userAgent.match('Version')) {
    // Insert logic here 
}

Whereas Chrome for iOS users could be filtered out with:

if(navigator.userAgent.match('CriOS')) {
    // Insert logic here 
}