用户代理在iOS 7 Safari浏览器 [英] User Agent for Safari browser on iOS 7

查看:493
本文介绍了用户代理在iOS 7 Safari浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开我只能在iPhone和iPod与Safari浏览器的网站。对于任何其他浏览器如Chrome,海豚等,它不应该打开。

I want to open my site only in iPhone and iPod with Safari browser. For any other browser like Chrome, Dolphin, etc, It shouldn't open.

但我目前几乎所有的设备得到同样的用户代理:

But currently I am getting the same user agent from almost all the devices:

有关Safari浏览器:

For Safari:

User Agent String :: mozilla/5.0 (iphone; cpu iphone os 7_0_2 like mac os x) applewebkit/537.51.1 (khtml, like gecko) version/7.0 mobile/11a501 safari/9537.53

有关Chrome的:

User Agent String :: mozilla/5.0 (iphone; cpu iphone os 7_0_2 like mac os x) applewebkit/537.51.1 (khtml, like gecko) crios/30.0.1599.16 mobile/11a501 safari/8536.25

有关水星的浏览器:

User Agent String :: mozilla/5.0 (iphone; cpu iphone os 6_0_1 like mac os x) applewebkit/536.26 (khtml, like gecko) mercury/7.4.2 mobile/10a523 safari/8536.25

有关海豚浏览器:

User Agent String :: mozilla/5.0 (iphone; cpu iphone os 7_0_2 like mac os x) applewebkit/537.51.1 (khtml, like gecko) version/6.0 mobile/10a523 safari/8536.25

使用铬我可以通过 crios ,水星检查汞字符串,但对于其他的看这似乎浏览器拥有相同的用户代理如Safari?

With Chrome I can see by checking for crios, and Mercury by mercury string, but what about the other browsers which seem to have same user agent as Safari?

推荐答案

答案并不完全正确。在iOS上,苹果阻止实际上包括他们自己的渲染引擎任何竞争的浏览器;都必须使用标准的web视图。

The other answer isn't strictly correct. On iOS, Apple block any competing browsers from actually including their own rendering engine; all must use the standard webview.

因此​​,所有这些第三方浏览器(使用功能,如同步收藏等)仅仅是围绕Safari浏览器供电的WebView包装这实际上是渲染页面,因此它们都具有Safari浏览器的用户代理字符串。

So all of those 3rd party browsers (with functionality such as syncing favourites, etc.) are simply wrappers around the Safari powered webview that's actually rendering the page, hence them all having Safari's user agent string.

这篇关于用户代理在iOS 7 Safari浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆