当我在 iOS 版 Chrome 中测试我的网络应用程序(包括 iPhone 和 iPad)时,我注意到一个奇怪的 ID 附加到用户代理字符串,例如:
alert(navigator.userAgent)
会产生这样的东西(注意末尾的“3810AC74-327F-43D7-A905-597FF9FDFEAB”部分):
Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/21.0.1180.77 Mobile/9B206 Safari/7534.48.3 (3810AC74-327F-43D7-A905-597FF9FDFEAB)
此 ID 似乎是特定于选项卡的,即使在转到其他站点时也会保留。
我的问题是,是否有人知道这件事以及它的用途?
更新:
此 GUID 已附加到 overcome the limitations of UIWebView .感谢eric在评论中指出这一点。
最佳答案
该 ID 与跟踪不有任何关系。
有一个chromium bug这详细说明了为什么它是必要的:基本上,它是实现选项卡所必需的。
来自错误跟踪器:
There is no API in iOS to know, in the network layer, from which UIWebView a network request is coming from.
[...] the solution [...] all the UIWebViews get the tabID (which is only local to the device) added to the user agent string.
关于javascript - iOS 版 Chrome 中附加到用户代理字符串的唯一标签 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12180224/