Html 使用 IE=edge,chrome=1 是否仍然有效?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22059060/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 01:04:02  来源:igfitidea点击:

Is it still valid to use IE=edge,chrome=1?

htmlinternet-explorermeta-tagsgoogle-chrome-framex-ua-compatible

提问by Brennan Sei

I read Chrome Frame closed last month, I thus tried to understand what it'd mean for the X-UA tag and after 3 hours of research I still didn't find the answer I'm looking for, my question is the following :

我阅读了上个月关闭的 Chrome Frame,因此我试图了解 X-UA 标签的含义,经过 3 个小时的研究,我仍然没有找到我正在寻找的答案,我的问题如下:

Is it still valid nowdays to use IE=edge,chrome=1 or should I stop at IE-edge from now on ? Or what would be the best pratice to do regarding X-UA, should it be avoided ?

现在使用 IE=edge,chrome=1 是否仍然有效,还是从现在开始我应该停止使用 IE-edge?或者关于 X-UA 的最佳实践是什么,应该避免吗?

回答by fny

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />serves two purposes.

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />有两个目的。

  1. IE=edge: specifies that IE should run in the highest mode available to that version of IE as opposed to a compatability mode; IE8 can support up to IE8 modes, IE9 can support up to IE9 modes, and so on.
  2. chrome=1: specifies that Google Chrome frame should start if the user has it installed
  1. IE=edge: 指定 IE 应该以该版本 IE 可用的最高模式运行,而不是兼容模式;IE8最多支持IE8模式,IE9最多支持IE9模式,依此类推。
  2. chrome=1: 指定如果用户安装了谷歌浏览器框架应该启动

The IE=edgeflag is still relevant for IE versions 10 and below. IE11 sets this mode as the default.

IE=edge标志仍然与 IE 版本 10 及以下版本相关。IE11 将此模式设置为默认模式。

As for the chrome flag, you can leave it if your users still use Chrome Frame. Despite support and updates for Chrome Frame ending, one can still install and usethe final release. If you remove the flag, Chrome Frame will not be activated when installed. For other users, chrome=1will do nothing more than consume a few bytes of bandwidth.

至于 chrome 标志,如果您的用户仍然使用 Chrome Frame,您可以保留它。尽管对 Chrome Frame 的支持和更新已结束,但仍然可以安装和使用最终版本。如果删除该标志,则安装时将不会激活 Chrome Frame。对于其他用户来说,chrome=1无非就是消耗几个字节的带宽。

I recommend you analyze your audience and see if their browsers prohibit any needed features and then decide. Perhaps it might be better to encourage them to use a more modern, evergreenbrowser.

我建议你分析你的受众,看看他们的浏览器是否禁止任何需要的功能,然后再决定。也许鼓励他们使用更现代、更常绿的浏览器可能会更好。

Note, the W3C validatorwill flag chrome=1as an error:

请注意,W3C 验证器将标记chrome=1为错误:

Error: A meta element with an http-equiv attribute whose value is
X-UA-Compatible must have a content attribute with the value IE=edge.

回答by Siriquelle

It's still valid to use IE=edge,chrome=1.

使用 IE=edge,chrome=1 仍然有效

But, since the chrome frame project has been wound down the chrome=1part is redundant for browsers that don't already have the chrome frame plug in installed.

但是,由于 chrome 框架项目已经结束,chrome=1部分对于尚未安装 chrome 框架插件的浏览器来说是多余的。

I use the following for correctness nowadays

我现在使用以下正确性

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

回答by Andre

<head>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>

worked for me, to force IE to "snap out of compatibility mode" (so to speak), BUT that metastatement must appear IMMEDIATELY after the <head>, or it won't work!

为我工作,强制 IE“退出兼容模式”(可以这么说),但语句必须立即出现在 之后<head>,否则它将不起作用!