用户代理字符串之间的区别

difference between the user agent strings

以下用户代理字符串有什么区别

Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko

我目前正在尝试调试特定于 IE 的 JS 问题,在调试时注意到有这 2 个不同的用户代理字符串,用于 windows 10 和 IE 11。

此外,用户代理有时在字符串 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0 中有 Gecko/20100101Gecko/20100101 的存在是否表示它总是 Desktop

谢谢。

Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

默认情况下,Windows 10 上的 Internet Explorer 11 发送上述 User-Agent 字符串:

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko

默认情况下,Windows 8.1 上的 Internet Explorer 11 发送以下 User-Agent 字符串:

Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko

Internet Explorer 11 延续了 IE9 在 navigator.userAgent 属性 中公开可扩展令牌但不在请求 header 中发送这些令牌的传统。例如,默认情况下 属性 returns IE11/Win8.1 上的以下内容:

Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko

此处的 .NET 令牌是从注册表中提取的,并允许 JavaScript 检测计算机上是否安装了 .NET Framework。 (它们有点误导,因为 Windows 8.1 包含框架的 4.5 版本。)

更多详细信息,请查看User Agent and Internet Explorer 11’s Many User-Agent String

Firefox 本身的 UA 字符串分为四个部分:

Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion

Gecko/geckotrail表示该浏览器基于Gecko。

在桌面上,geckotrail 是固定字符串“20100101”。

有关 Firefox 用户代理字符串的更多详细信息,请查看 the Firefox user agent string reference

编辑:

[注意] 在 Windows、Macintosh、Linux、Firefox for Maemo (Nokia N900)、Camino on Mac、Windows 上的 SeaMonkey、Mac 上的 SeaMonkey 和 Linux 上的 SeaMonkey,Firefox 用户代理字符串包含“20100101”。