ipad user agent changes during use?

老子叫甜甜 提交于 2019-12-20 03:23:22

问题


In the logs of our website, we are occasionally seeing the user agent of an iPad 'switch' from one set of requests to the next.

On one set of requests that occur simultaneously, the user agent will look like this (which is the style of user agent we see most of the time for iPads):

mozilla/5.0+(ipad;+u;+cpu+os+4_2_1+like+mac+os+x;+en-us)+applewebkit/533.17.9+(khtml,+like+gecko)+version/5.0.2+mobile/8c148+safari/6533.18.5

The user then clicks a link or a button; the next series of requests will have a user agent setting like:

mozilla/5.0+(ipad;+u;+cpu+os+4_2_1+like+mac+os+x;+en-us)+applewebkit/533.17.9+(khtml,+like+gecko)+mobile/8c148

Notice how safari & the version fields are missing from the second. We are trying to understand what action or functionality on the iPad would cause this switch to take place, so we can replicate it in our test environment.


回答1:


Posting all my findings related to this: Looks like the difference is in-fact between web-app mode and safari mode. You'll get the short user agent in web-app mode (and have no browser bar), the long user agent in safari mode. There are two ways to get into web app mode:

  1. Create a web clip and check the 'Full Screen' checkbox
  2. Add a meta tag to your website <meta name="apple-mobile-web-app-capable" content="yes">

As for why we see both user agents from the same user? When you enter a site in web app mode, clicking on a link will swap the web app and re-open the page in Safari. This will also have cause the cookies to clear, possibly playing foul with your authentication scheme.



来源:https://stackoverflow.com/questions/5353926/ipad-user-agent-changes-during-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!