代码之家  ›  专栏  ›  技术社区  ›  Knu

如何在JavaScript中检测Windows10上的IE11?

  •  1
  • Knu  · 技术社区  · 7 年前
    • 它不应该依赖于一个容易被欺骗的方法。 (例如,用户代理)
    • 早期版本的Windows不应该使用它

    afaik Windows 8.1和Windows 10上IE11的唯一区别是删除了p3p。
    是否有其他可用于检测的更改/未修复的错误?
    有点像 IE11 on Windows 7 指南“但是对于Windows 10来说”在这方面非常有用。

    1 回复  |  直到 7 年前
        1
  •  0
  •   Knu    7 年前

    我是这样做的:

    if (
         // is IE 11 even in web workers
         !self.ActiveXObject && 'ActiveXObject' in self &&
    
         // exclude Windows 7/8/8.1 and Windows Phone 8.1
         /Windows NT 10.0/.test(self.navigator.userAgent)
       )
       console.log('IE11 on Windows 10');
    

    我也读过 HTTP/2 support is Windows 10 specific .