我想用Safari浏览器在iPhone和iPod中打开我的网站.对于任何其他浏览器,如Chrome,Dolphin等,它不应该打开.
但目前我从几乎所有设备获得相同的用户代理:
对于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
Run Code Online (Sandbox Code Playgroud)
对于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
Run Code Online (Sandbox Code Playgroud)
对于Mercury浏览器:
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
Run Code Online (Sandbox Code Playgroud)
对于Dolphin浏览器:
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
Run Code Online (Sandbox Code Playgroud)
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?
浏览器非常故意这样做,以防止人们做你想做的事情.他们的开发人员认为,由于他们使用相同的Web引擎(WebKit,blink或gecko),因此他们会轻松地为类似浏览器优化页面(这可能是真的).
所以很可能没有办法说出来.
| 归档时间: |
|
| 查看次数: |
36863 次 |
| 最近记录: |