0

在 iPad (2+) 上 Chrome 浏览器(它是原生 Safari 浏览器 AFAIK 的包装器)不会触发某些事件(例如当用户关闭浏览器时)。这会导致误报“应用程序已崩溃”报告。

所以我们想从某种包装器中过滤掉正在使用 Safari 的用户。

有什么方法可以检测到(相对容易)?

堆栈:PhP、.JS、jQuery

4

1 回答 1

1

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 
}
于 2015-08-14T22:18:06.593 回答