使用文档模式和企业模式站点列表修复 Web 兼容性问题Fix web compatibility issues using document modes and the Enterprise Mode site list

重要

从 2021 年 8 月 17 日开始,Microsoft 365 应用和服务将不支持 Internet Explorer 11(从 2020 年 11 月 30 日开始,Microsoft Teams 将不再支持 Internet Explorer 11)。Microsoft 365 apps and services will not support Internet Explorer 11 starting August 17, 2021 (Microsoft Teams will not support Internet Explorer 11 earlier, starting November 30, 2020). 了解详细信息Learn more. 请注意,Internet Explorer 11 仍将是受支持的浏览器。Please note that Internet Explorer 11 will remain a supported browser. Internet Explorer 11 是 Windows 操作系统的一个组件,遵循安装它的产品的生命周期策略Internet Explorer 11 is a component of the Windows operating system and follows the Lifecycle Policy for the product on which it is installed.

Internet Explorer 11 企业模式站点列表允许你指定特定网站的文档模式,从而帮助你修复兼容性问题,而无需更改站点上的任一行代码。The Internet Explorer 11 Enterprise Mode site list lets you specify document modes for specific websites, helping you fix compatibility issues without changing a single line of code on the site. 站点列表的这一添加项就是我们致力于帮助你升级和保持最新版本的 Internet Explorer 的延续,同时仍保留你对现有应用的投入。This addition to the site list is a continuation of our commitment to help you upgrade and stay up-to-date on the latest version of Internet Explorer, while still preserving your investments in existing apps.

这对我意味着什么?What does this mean for me?

企业可能具有为特定浏览器版本显式编码的和可能不受其直接控制的关键应用,使得更新到现代标准或较新的浏览器版本非常困难且成本高昂。Enterprises can have critical apps that are coded explicitly for a specific browser version and that might not be in their direct control, making it very difficult and expensive to update to modern standards or newer browser versions. 因为你可以确定应该使用特定的文档模式打开哪些 URL,所以此更新有助于确保更好的兼容性、更快的升级速度和更低的测试和修复成本。Because you can decide which URLs should open using specific document modes, this update helps ensure better compatibility, faster upgrades, and reduced testing and fixing costs.

该修补程序是如何工作的?How does this fix work?

通过在集中式企业模式站点列表中指定文档模式,可以继续使用旧的和孤立的 Web 应用。You can continue to use your legacy and orphaned web apps, by specifying a document mode in the centralized Enterprise Mode site list. 然后,当 IE11 转到你的列表上的某个站点时,浏览器将加载指定的文档模式中的页面,就像是通过站点上的 X-UA-Compatible meta 标记指定的那样。Then, when IE11 goes to a site on your list, the browser loads the page in the specified document mode just as it would if it were specified through an X-UA-Compatible meta tag on the site. 有关文档模式和 X-UA-compatible 标头的详细信息,请参阅定义文档兼容性For more information about document modes and X-UA-compatible headers, see Defining document compatibility.

重要提示Important
由于企业模式优先于文档模式,因此已包含在企业模式站点列表中的站点不会受此更新影响,并将继续照常在企业模式中加载。Enterprise Mode takes precedence over document modes, so sites that are already included in the Enterprise Mode site list won’t be affected by this update and will continue to load in Enterprise Mode, as usual.

何时使用文档模式与企业模式?When do I use document modes versus Enterprise Mode?

尽管 <emie> 功能为你在 Windows Internet Explorer 8 或 Windows Internet Explorer 7 上提供了出色的兼容性,新的 <docMode> 功能可以帮助你保持最新状态而不用考虑在你的环境中运行的是哪个版本的 IE。While the <emie> functionality provides great compatibility for you on Windows Internet Explorer 8 or Windows Internet Explorer 7, the new <docMode> capabilities can help you stay up-to-date regardless of which versions of IE are running in your environment. 因此,我们建议按如下所示开始测试过程:Because of this, we recommend starting your testing process like this:

  • 如果你的企业主要使用 Internet Explorer 8 或 Internet Explorer 7,请在企业模式下开始测试。If your enterprise primarily uses Internet Explorer 8 or Internet Explorer 7 start testing using Enterprise Mode.

  • 如果你的企业主要使用 Windows Internet Explorer 9 或 Internet Explorer 10,请在不同文档模式下开始测试。If your enterprise primarily uses Windows Internet Explorer 9 or Internet Explorer 10, start testing using the various document modes.

因为你可能已部署多个版本的 IE,所以可能需要同时使用企业模式和文档模式才能有效地迁移到 IE11。Because you might have multiple versions of IE deployed, you might need to use both Enterprise Mode and document modes to effectively move to IE11.

测试站点的文档模式兼容性Test your sites for document mode compatibility

若要查看该修补程序是否对你有帮助,请对每个有问题的站点逐步完成此过程:To see if this fix might help you, run through this process one step at a time, for each of your problematic sites:

  1. 转到存在兼容性问题的站点并按“F12”**** 打开“F12 开发人员工具”****,然后转到“模拟”**** 工具。Go to a site having compatibility problems, press F12 to open the F12 Developer Tools, and go to the Emulation tool.

    显示文档模式选定内容的模拟工具

  2. 从“11 (默认)”**** 选项开始,测试出现问题的场景。Starting with the 11 (Default) option, test your broken scenario.
    如果它不起作用,则继续到下一个最低的文档模式,在找到可修复问题的文档模式后立即停止。If that doesn’t work, continue down to the next lowest document mode, stopping as soon as you find a document mode that fixes your problems. 有关模拟工具的详细信息,请参阅模拟浏览器、屏幕大小和 GPS 位置For more information about the Emulation tool, see Emulate browsers, screen sizes, and GPS locations.

  3. 如果没有任何文档模式可修复你的问题,请将“浏览器配置文件”**** 更改为“企业”****,从“8”****(IE8 企业模式)开始选取所需模式,然后测试出现问题的场景。If none of the document modes fix your issue, change the Browser Profile to Enterprise, pick the mode you want to test with starting with 8 (IE8 Enterprise Mode), and then test your broken scenario.

将站点添加到企业模式站点列表Add your site to the Enterprise Mode site list

了解可修复兼容性问题的文档模式后,可以将该站点添加到你的企业模式站点列表中。After you’ve figured out the document mode that fixes your compatibility problems, you can add the site to your Enterprise Mode site list.

注意Note
有两个版本的企业模式站点列表架构和 Enterprise Mode Site List Manager,具体取决于你的操作系统。There are two versions of the Enterprise Mode site list schema and the Enterprise Mode Site List Manager, based on your operating system. 有关架构的详细信息,请参阅企业模式架构 v.2 指南企业模式架构 v.1 指南For more info about the schemas, see Enterprise Mode schema v.2 guidance or Enterprise Mode schema v.1 guidance. 有关不同站点列表管理工具的详细信息,请参阅使用 Enterprise Mode Site List ManagerFor more info about the different site list management tools, see Use the Enterprise Mode Site List Manager.

将站点添加到站点列表To add your site to the site list

  1. 打开 Enterprise Mode Site List Manager,然后单击添加Open the Enterprise Mode Site List Manager, and click Add.

    显示可用模式的 Enterprise Mode Site List Manager

  2. 添加URL,然后从启动模式框中选取文档模式。Add the URL and pick the document mode from the Launch in box. 此文档模式应与测试站点时找到的可修复你的问题的文档模式相同。This should be the same document mode you found fixed your problems while testing the site.
    与企业模式类似,你可以为特定的 Web 路径(如 contoso.com/ERP)或在域级别上指定文档模式。Similar to Enterprise Mode, you can specify a document mode for a particular web path—such as contoso.com/ERP—or at a domain level. 在上述内容中,整个 contoso.com 域将在企业模式中加载,而 microsoft.com 将强制加载到 IE8 文档模式中,bing.com 将加载到 IE11。In the above, the entire contoso.com domain loads in Enterprise Mode, while microsoft.com is forced to load into IE8 Document Mode and bing.com loads in IE11.

注意Note
有关企业模式的详细信息,请参阅什么是企业模式?For more information about Enterprise Mode, see What is Enterprise Mode? 有关 Enterprise Mode Site List Manager 以及如何将站点添加到你的站点列表的详细信息,请参阅 Enterprise Mode Site List ManagerFor more information about the Enterprise Mode Site List Manager and how to add sites to your site list, see Enterprise Mode Site List Manager.

查看企业模式站点列表Review your Enterprise Mode site list

看一看企业模式站点列表,并确保一切都如你所愿。Take a look at your Enterprise Mode site list and make sure everything is the way you want it. 下一步将打开该列表并开始在你的公司中使用它。The next step will be to turn the list on and start to use it in your company. Enterprise Mode Site List Manager 将如下所示:The Enterprise Mode Site List Manager will look something like:

显示不同模式的 Enterprise Mode Site List Manager

而基本的 XML 代码将如下所示:And the underlying XML code will look something like:

<rules version="1">
  <emie>
       <domain exclude="false">bing.com<path exclude="false" forceCompatView="true">/images</path></domain>
       <domain exclude="true">www.msn.com<path exclude="true">/news</path></domain>
  </emie>
  <docmode />
  <docMode>
       <domain docMode="edge">timecard</domain>
       <domain docMode="edge">tar</domain>
       <domain docMode="9">msdn.microsoft.com</domain>
  </docMode>
</rules>

打开企业模式并使用站点列表Turn on Enterprise Mode and using your site list

如果你尚未为公司打开企业模式,则将需要执行此操作。If you haven’t already turned on Enterprise Mode for your company, you’ll need to do that. 你可以使用组策略或注册表打开企业模式。You can turn on Enterprise Mode using Group Policy or your registry. 有关特定说明和详细信息,请参阅打开企业模式并使用站点列表For specific instructions and details, see Turn on Enterprise Mode and use a site list.

关闭 Intranet 站点的默认兼容性视图Turn off default Compatibility View for your intranet sites

默认情况下,IE11 使用“在兼容性视图中显示 Intranet 站点”**** 设置。By default, IE11 uses the Display intranet sites in Compatibility View setting. 但是,我们收到你的反馈,并了解到你可能想要关闭此功能,以便可以继续将你的 Web 应用升级为更具现代标准的应用。However, we’ve heard your feedback and know that you might want to turn this functionality off so you can continue to upgrade your web apps to more modern standards.

为了帮助你升级,你现在可以使用企业模式站点列表来指定站点或 Web 路径以使用 IE7 文档模式,如果页面没有显式的 DOCTYPE 标记,则该文档模式将向下转至 IE5“Quirks”模式。To help you move forward, you can now use the Enterprise Mode site list to specify sites or web paths to use the IE7 document mode, which goes down to IE5 “Quirks” mode if the page doesn’t have an explicit DOCTYPE tag. 有效地使用此文档模式可帮助你为一个站点或一组站点提供兼容性视图功能,经过全面的测试之后,它可帮助你关闭作为 Intranet 站点的默认设置的兼容性视图。Using this document mode effectively helps you provide the Compatibility View functionality for single sites or a group of sites, which after thorough testing, can help you turn off Compatibility View as the default setting for your intranet sites.