检测Metro IE10与桌面IE10 [英] Detecting Metro IE10 vs Desktop IE10

查看:72
本文介绍了检测Metro IE10与桌面IE10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


由于UA在它们之间基本相同,是否有一种可靠的方法来检测用户是否正在访问具有Metro IE10浏览器与桌面IE10浏览器相比?  我想根据使用的
浏览器显示一些备用内容(例如:IE Classic,IE Metro,Firefox,Chrome等不同的详细下载说明)。  我注意到的一件事是navigator.platform是"Win32"。对于x86和x64 Classic IE10以及它的"Win64"而言对于Metro IE10,但我不是
肯定会有多可靠。   IE10中是否有任何功能在另一个中不可用?

Since the UA is essentially the same between them, is there a reliable way to detect whether a user is a visiting a web page with the Metro IE10 browser vs. the Desktop IE10 browser?  I'd like to display some alternate content based on the browser being used (ex: detailed download instructions which differ between IE Classic, IE Metro, Firefox, Chrome, etc.).  One thing I did notice is that navigator.platform is "Win32" for both the x86 and x64 Classic IE10 and it's "Win64" for Metro IE10, but I'm not sure how reliable that will be.  Are there any features in one IE10 that's not available in the other?

推荐答案

我在64位Windows上尝试过它8 Consumer Preview并在维基百科中
here
<bsp!答案给我答案。

Once I tried it on my 64-bit Windows 8 Consumer Preview and gave my answers here in Wikipedia.

我发现但我的IE10标准模式的UA字符串是"Mozilla / 5.0(兼容; MSIE 10.0; Windows NT 6.2; WOW64; Trident / 6.0; .NET4.0E; .NET4.0C; Media Center PC" 6.0)" ;.在桌面视图中;和"Mozilla / 5.0(兼容; MSIE 10.0; Windows NT 6.2; Win64;
x64; Trident / 6.0; .NET4.0E; .NET4.0C; Media Center PC 6.0)"和在地铁视图中。两者都在标准模式下。

I found but the UA string of my IE10's standards mode is "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; Media Center PC 6.0)". in desktop view; and "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C; Media Center PC 6.0)" in the Metro view. Both in the standards mode.


这篇关于检测Metro IE10与桌面IE10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆