Javascript Windows 10 为浏览器的用户代理设置了什么操作系统名称?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26652394/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What OS name does Windows 10 set to browser's user agent?
提问by Eadel
It is possible to check in browser's navigator.userAgentthe operation system of the user. I know we can't rely on browser's user agent because it can be spoofed, but we need it for a statistics purpose only. For Windowsenvironments, value Windows NT 6.3stands for Win 8.1, Windows NT 6.2for Win 8, Windows NT 6.1for Win 7 and so on. Could anyone advise what value does Windows 10 put in user agent?
Thank you in advance.
可以在浏览器中查看navigator.userAgent用户的操作系统。我知道我们不能依赖浏览器的用户代理,因为它可以被欺骗,但我们只需要它用于统计目的。对于Windows环境,valueWindows NT 6.3代表 Win 8.1、Windows NT 6.2Win 8、Windows NT 6.1Win 7 等。任何人都可以建议 Windows 10 在用户代理中放置什么价值?
先感谢您。
回答by chue x
@NulledPointer has pointed out that the IE user agent will contain Windows NT 10.0. This is true as of the November 2014 CTP of Windows 10. That particular CTP introduces IE Edge Mode, which will be the only operating mode available for the release version of Windows 10. Here is a sample user agent string from @NulledPointer's link:
@NulledPointer 指出IE 用户代理将包含Windows NT 10.0。从 2014 年 11 月的 Windows 10 CTP 开始,情况确实如此。该特定 CTP 引入了IE Edge Mode,这将是 Windows 10 发行版唯一可用的操作模式。以下是来自 @NulledPointer 链接的示例用户代理字符串:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0

