IE11和神秘的缺少浏览器模式

时间:2024-03-02 19:42:52

Please note that some information in this article has been superseded. Please see IE11: Browser Modes Return.

请注意,本文中的某些信息已被取代。 请参阅IE11:浏览器模式返回

Web developers give Microsoft a tough time. “Follow W3C standards”, we shout. “Force everyone to upgrade their browser”, we screech. “IE ate my kitten”, we bellow.

Web开发人员使Microsoft处境艰难。 我们大喊“遵循W3C标准” 。 我们尖锐地说: “强迫所有人升级他们的浏览器”“我吃了我的小猫” ,我们吼叫。

Some criticism was deserved. Microsoft abandoned their flagship browser, held back web evolution and they still take too long to release new versions. But, if we ignore the abomination that was IE7, the company has significantly improved Internet Explorer during the past five years. IE8 and a few shims remain adequate for all but the most sophisticated applications. IE9 won’t cause many issues unless you’re after CSS3 animations. IE10 is a solid alternative to any of the competing browsers.

值得批评。 微软放弃了他们的旗舰浏览器,阻碍了网络的发展,他们仍然花费很长时间发布新版本。 但是,如果我们忽略了IE7的可憎之处,则该公司在过去五年中已大大改善了Internet Explorer。 IE8和一些垫片对于大多数最复杂的应用程序仍然适用。 除非您关注CSS3动画,否则IE9不会引起很多问题。 IE10是任何竞争浏览器的可靠替代品。

You’ll still find issues in IE (please Microsoft — add transform-style: preserve-3d;), but you’ll find issues in every browser. None are perfect. Those who rant loudest usually find it easier to blame Microsoft than fix cross-browser issues in their own code.

您仍然会在IE中发现问题(请Microsoft- 添加transform-style: preserve-3d; ),但是在每种浏览器中都会发现问题。 没有一个是完美的。 那些大声疾呼的人通常发现,责怪微软比在自己的代码中解决跨浏览器问题更容易。

IE11, to be launched with Windows 8.1 on October 18, 2013, finally includes WebGL and a great set of developer tools. You can install it today if you’re an MSDN subscriber (thanks to a little back-tracking on Microsoft’s previous decision). A version for Windows 7 will arrive a few weeks later.

IE11将于2013年10月18日与Windows 8.1一起发布,最终包括WebGL和大量开发人员工具 。 如果您是MSDN订阅者,则可以立即安装(由于对Microsoft先前的决定进行了一些追溯 )。 Windows 7的一个版本将在几周后到货。

However, one missing feature will incur the wrath of developers everywhere: browser modes have gone!

但是,缺少的一项功能将引起各地开发人员的愤怒: 浏览器模式已消失!

什么是浏览器模式? (What are Browser Modes?)

The developer tools in IE8, 9 and 10 provided an increasing number of browser rendering modes going back to IE7.

IE8、9和10中的开发人员工具提供了回溯到IE7的越来越多的浏览器渲染模式。

IE10 browser modes

The modes were added following compatibility outcries after IE7 was launched in 2006. The browser fixed several of the quirks and proprietary technologies developers utilized in IE6 so many applications broke following a browser upgrade. Browser modes was a solution which allowed companies to continue using legacy applications while they fixed the problems. An HTTP header or meta tag could force newer editions of IE to act like previous versions.

在2006年IE7推出之后,由于兼容性问题而增加了这些模式。浏览器修复了IE6中使用的一些怪癖和专有技术开发人员,因此许多应用程序在浏览器升级后崩溃了。 浏览器模式是一种解决方案,可让公司在解决问题的同时继续使用旧版应用程序。 HTTP标头或元标记可能会迫使IE的较新版本像以前的版本一样工作。

但这不是仿真 (But it’s Not Emulation)

Perhaps companies still use the modes but I bet far more developers use them for quick and dirty testing in older editions of IE. I certainly have. Browser mode removal will be ridiculed but there are a number of reasons why their demise should be welcomed:

也许公司仍在使用这些模式,但我敢打赌,会有更多的开发人员在较旧版本的IE中使用它们进行快速而肮脏的测试。 我当然有 浏览器模式的删除将被嘲笑,但是有许多原因使它们的消亡受到欢迎:

  • Browser modes were a temporary fix for a specific purpose; not application testing.

    浏览器模式是用于特定目的的临时修复程序; 不是应用程序测试。
  • Browser modes are no substitute for testing the real applications. Microsoft does not include four versions of Trident in IE10 — the browser makes superficial tweaks. Your site may work in IE7 mode but fail dismally in a real installation. (Note this also true for third-party solutions such as IETester.)

    浏览器模式不能替代测试实际的应用程序。 Microsoft在IE10中不包含Trident的四个版本-浏览器进行了表面的调整。 您的站点可能在IE7模式下工作,但在实际安装中会失败。 (请注意,对于第三方解决方案(例如IETester )也是如此。)

  • Browser modes should die. There were radical differences between IE6, 7, 8 and 9 but far fewer between IE9, 10 and 11. It shouldn’t be necessary to test older browsers in a world where users upgrade automatically. You don’t test Chrome 23 or Firefox 17; IE should be no different.

    浏览器模式应该消失。 IE6、7、8和9之间存在根本差异,但IE9、10和11之间相差甚远。在用户自动升级的世界中,不必测试较旧的浏览器。 您无需测试Chrome 23或Firefox 17; IE应该没有什么不同。

回到现实 (Back to Reality)

For most of us, IE6 and 7 are dead. IE9 is dropping rapidly as Windows 7/8 users upgrade to IE10 — and both browsers are generally well-behaved. Unfortunately, IE8 retains a healthy 8% market share despite Microsoft’s attempts to encourage Windows XP migration. You therefore have three choices once IE11 is installed on your PC:

对于我们大多数人来说,IE6和7已死。 随着Windows 7/8用户升级到IE10,IE9Swift下降-两种浏览器的性能通常都很好。 不幸的是,尽管微软试图鼓励Windows XP迁移,但IE8仍然保持了8%的健康市场份额 。 因此,一旦在PC上安装了IE11,您就有三种选择:

  1. Don’t bother testing IE8. Google doesn’t. With luck — and a little careful coding — your site will degrade gracefully much like any other aging browser.

    不要费心测试IE8。 Google不会。 如果运气好-并进行了一些仔细的编码-您的网站将像其他任何老化的浏览器一样正常降级。
  2. Use a browser rendering service such as BrowserStack, BrowserShots or NetRenderer. These are good for rudimentary cosmetic testing.

    使用浏览器呈现服务,例如BrowserStackBrowserShotsNetRenderer 。 这些对于基本的化妆品测试非常有用。

  3. Test your site in real installation of IE8. You need not buy another PC; Microsoft provide free virtual machines for Windows, Mac OS and Linux at modern.ie.

    在IE8的实际安装中测试您的网站。 您无需购买另一台PC。 微软在modern.ie上为Windows,Mac OS和Linux提供免费的虚拟机。

But please don’t be tempted to retain IE10 or use registry hacks to re-enable browser modes! They’ve always been flawed and lull you into a false sense of satisfaction. The sooner people upgrade, the sooner we can abandon ancient browsers.

但是,请不要试图保留IE10或使用注册表黑客来重新启用浏览器模式! 他们总是有缺陷,会让您产生一种虚假的满足感。 人们越早升级,我们越早放弃古老的浏览器。

Please note that some information in this article has been superseded. Please see IE11: Browser Modes Return.

请注意,本文中的某些信息已被取代。 请参阅IE11:浏览器模式返回

翻译自: https://www.sitepoint.com/ie11-mysterious-missing-browser-modes/