25

我正在尝试确定表面 RT 的用户代理字符串以进行测试。

4

7 回答 7

24

只需做一些谷歌搜索,您就会找到答案。

Internet Explorer 10 用户代理字符串

Windows RT 上的 Internet Explorer 10:

Mozilla/5.0(兼容;MSIE 10.0;Windows NT 6.2;ARM;Trident/6.0)

在下面评论后更新

上面的链接还指出:

识别支持触摸的系统
Internet Explorer 10 引入了“触摸”UA 字符串标记。如果此令牌出现在 UA 字符串的末尾,则计算机具有触摸功能,并且正在运行 Windows 8(或更高版本)。此 UA 字符串将在运行 Windows 8 的支持触控的系统上传输。
注意 Windows 7 上的 Internet Explorer 10 永远不会报告带有“Touch”令牌的 UA 字符串。

Windows RT 上启用触控的 Internet Explorer 10:

Mozilla/5.0(兼容;MSIE 10.0;Windows NT 6.2;ARM;Trident/6.0;Touch)


Internet Explorer 11 更新

用户代理字符串更改

以下是针对 Windows 8.1 上的 Internet Explorer 11 的报告:

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

这是 Windows 7 上 Internet Explorer 11 的字符串:

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

如果您将这些值与早期版本的 Internet Explorer 报告的值进行比较,您会发现以下变化:

  • 兼容(“compatible”)和浏览器(“MSIE”)令牌已被删除。
  • 添加了“like Gecko”标记(为了与其他浏览器保持一致)。
  • 浏览器的版本现在由新的修订 (“rv”) 标记报告。
于 2012-10-25T20:39:38.673 回答
4

我昨天(2012 年 11 月 13 日)去了微软零售店,并使用 IE在 Metro 和 Desktop 模式下浏览到http://whatsmyuseragent.com/ 。

这是两种情况下给出的用户代理:

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)
于 2012-11-14T14:41:45.853 回答
4

对于那些感兴趣的人。这是 Surface Pro (128Gb) 的用户代理字符串:

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0; Touch)
于 2013-03-14T14:03:27.470 回答
2

其实大家都错了。在 Metro 模式中出现的实际用户代理是

Mozilla/4.0(兼容;msie 7.0;windows nt 6.2;arm;trident/6.0;touch;.net4.0e;.net4.0c;tablet PC 2.0;版本)。

于 2012-11-06T23:19:16.990 回答
2

这是我访问 whatsmyuseragent 网站时得到的:

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

希望这可以帮助。

于 2015-02-11T22:45:44.507 回答
1

Surface RT 将仅运行 IE 10。用户代理字符串为
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)

(来源:此MSDN 博客条目
此类信息通常在底层浏览器/机器交付之前很早就发布,因为 Web 浏览器制造商希望看到大多数网站都支持的新浏览器。

于 2012-10-25T20:47:22.870 回答
0

设备的用户代理 -

IE 桌面- “Mozilla/5.0(Windows NT 10.0;WOW64;Trident/7.0;.NET4.0C;.NET4.0E;.NET CLR 2.0.50727;.NET CLR 3.0.30729;.NET CLR 3.5.30729;InfoPath .3; rv:11.0) 像壁虎"

IE Surface Pro - “Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; Tablet PC 2.0; rv 11.0) 像 Gecko”

Edge 桌面- “Mozilla/5.0 (Windows NT 10.0; Win64; x64; ServiceUI 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063”

边缘表面 - “Mozilla/5.0 (Windows NT 10.0; Win64; x64; ServiceUI 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134”

通过查看上面的用户代理,我们并没有明确区分 Edge 的桌面和 Surface Pro(IE 有 Tablet PC check 可用)。所以这里先检测window设备(surface pro是window tablet),然后验证设备是否是触控设备。

窗口 + 触摸:真 - Surface Pro

窗口 + 触摸:假 - 桌面

isSurface: function () {
  // Window device Check
  if(!!navigator.userAgent.match(/Win/)) { 
  // Check if the device is touch               
  return !!navigator.userAgent.match(/Tablet PC/i) || "ontouchstart" in document.documentElement; 
  }
}
于 2018-10-04T12:33:50.867 回答