<i id='aT5Uh'><tr id='aT5Uh'><dt id='aT5Uh'><q id='aT5Uh'><span id='aT5Uh'><b id='aT5Uh'><form id='aT5Uh'><ins id='aT5Uh'></ins><ul id='aT5Uh'></ul><sub id='aT5Uh'></sub></form><legend id='aT5Uh'></legend><bdo id='aT5Uh'><pre id='aT5Uh'><center id='aT5Uh'></center></pre></bdo></b><th id='aT5Uh'></th></span></q></dt></tr></i><div id='aT5Uh'><tfoot id='aT5Uh'></tfoot><dl id='aT5Uh'><fieldset id='aT5Uh'></fieldset></dl></div>
      • <bdo id='aT5Uh'></bdo><ul id='aT5Uh'></ul>

      1. <tfoot id='aT5Uh'></tfoot>

      2. <legend id='aT5Uh'><style id='aT5Uh'><dir id='aT5Uh'><q id='aT5Uh'></q></dir></style></legend>
      3. <small id='aT5Uh'></small><noframes id='aT5Uh'>

      4. 检测 IE 的 Metro UI 版本

        时间:2023-09-29

        <small id='GI67O'></small><noframes id='GI67O'>

          <tbody id='GI67O'></tbody>

        • <bdo id='GI67O'></bdo><ul id='GI67O'></ul>

          <legend id='GI67O'><style id='GI67O'><dir id='GI67O'><q id='GI67O'></q></dir></style></legend>
              <tfoot id='GI67O'></tfoot>
                  <i id='GI67O'><tr id='GI67O'><dt id='GI67O'><q id='GI67O'><span id='GI67O'><b id='GI67O'><form id='GI67O'><ins id='GI67O'></ins><ul id='GI67O'></ul><sub id='GI67O'></sub></form><legend id='GI67O'></legend><bdo id='GI67O'><pre id='GI67O'><center id='GI67O'></center></pre></bdo></b><th id='GI67O'></th></span></q></dt></tr></i><div id='GI67O'><tfoot id='GI67O'></tfoot><dl id='GI67O'><fieldset id='GI67O'></fieldset></dl></div>
                • 本文介绍了检测 IE 的 Metro UI 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  什么是最快的方法,将 User-Agent 检测为 metro internet-explorer >=10 ?

                  What's the fastest method, to detect User-Agent as metro UI version of internet-explorer >=10 ?

                  推荐答案

                  所以,似乎没有明确的测试来识别 Metro IE 与 Desktop IE,但您似乎确实有一些不同的数据可以尝试使用来假设它是 Metro.不幸的是,我发现的所有项目都无法通过其他设置来解释.换句话说,对于我发现的所有功能"测试,Desktop IE 可以配置为诱使测试认为它是在 Metro 上运行的.

                  So, there doesn't appear to be a definitive test to identify Metro IE vs Desktop IE, but there does seem to be a few different pieces of data you can attempt to use to assume that it is Metro. Unfortunately, none of the items I have found can't be explained away by other settings. In other words, for all the "feature" tests I have found, Desktop IE could be configured in a way to trick the tests into thinking it was running on Metro.

                  是否禁用 ActiveX(Metro 不允许任何 activex 内容,但桌面 IE 也可以将其设置为禁用):

                  Is ActiveX disabled (Metro doesn't allow any activex content, but desktop IE can have it set to disabled as well):

                  function isActivexEnabled() {
                      var supported = null;        
                      try {
                          supported = !!new ActiveXObject("htmlfile");
                      } catch (e) {
                          supported = false;
                      }
                  
                      return supported;
                  }
                  

                  用户代理字符串检查(Metro 将始终在 64 位模式下运行,但不会在 32 位机器上运行,并且桌面 IE 可以配置为在 64 位模式下运行,不确定这些选项中的任何一个有多受欢迎)

                  User Agent string check (Metro will always run in 64bit mode, but won't on a 32bit machine, and Desktop IE can be configured to run in 64bit mode as well not sure how popular either of those options will be)

                  function isWin64() {
                      return navigator.platform == "Win64";
                  }
                  

                  全屏检查(Metro 将始终处于全屏模式,但桌面 IE 也可以以全屏模式运行,但这可以作为 Metro 模式的支持证据)

                  Full screen check (Metro will always be in full screen mode, however Desktop IE can also run in full screen mode, but this could be used as supporting evidence of Metro mode)

                  function isFullScreen() {
                     return (window.innerWidth == screen.width && 
                             window.innerHeight == screen.height);
                  }
                  

                  简而言之,我认为您必须尝试检查一堆功能,然后猜测,没有确定的方法.或者您可以接受 MS 不希望您这样做,并对您想要使用的功能使用功能检测.

                  In short, I think you have to try to check a bunch of features, and then guess, there is no definitive way. Or you could just accept that MS doesn't want you to do this, and use feature detection for the features you want to use.

                  对于那些想要尝试提供 UI 以引用包含浏览器 UI(例如指示如何固定网页)的用户,请记住其他 Metro 应用程序可以将 IE10 Metro 浏览器嵌入为控件,因此即使您可以将浏览器识别为 Metro 与桌面,UI 也可能不是您试图引用它的地方,因此这最终可能是一个非常棘手的情况,要在 100% 的时间里正确.因此,要么不要尝试,要么您可以尝试其他检测技术并接受您可能会显示错误 UI 的用例.

                  For those that want to try to provide UI to refer to the containing browser UI (to indicate how to Pin the web page for example), keep in mind that other Metro apps can embed the IE10 Metro browser as a control, so even if you could identify the browser as Metro vs desktop, the UI might not be where you'd attempt to refer to it, so this can end up being a pretty tricky situation to get right 100% of the time. So either, don't try, or you could attempt the other detection techniques and accept that there are use cases that you could be displaying the wrong UI.

                  这篇关于检测 IE 的 Metro UI 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:具有大型数据集的 DC 和交叉过滤器 下一篇:引用 TypeScript 文件在输出中包含整个文件

                  相关文章

                  • <bdo id='8GN2R'></bdo><ul id='8GN2R'></ul>
                  <tfoot id='8GN2R'></tfoot>

                    <legend id='8GN2R'><style id='8GN2R'><dir id='8GN2R'><q id='8GN2R'></q></dir></style></legend>
                      <i id='8GN2R'><tr id='8GN2R'><dt id='8GN2R'><q id='8GN2R'><span id='8GN2R'><b id='8GN2R'><form id='8GN2R'><ins id='8GN2R'></ins><ul id='8GN2R'></ul><sub id='8GN2R'></sub></form><legend id='8GN2R'></legend><bdo id='8GN2R'><pre id='8GN2R'><center id='8GN2R'></center></pre></bdo></b><th id='8GN2R'></th></span></q></dt></tr></i><div id='8GN2R'><tfoot id='8GN2R'></tfoot><dl id='8GN2R'><fieldset id='8GN2R'></fieldset></dl></div>
                    1. <small id='8GN2R'></small><noframes id='8GN2R'>