How browsers work 浏览器是如何工作的(WIP)

Behind the scenes of modern web browsers

前言

This comprehensive primer on the internal operations of WebKit and Gecko is the result of much research done by Israeli developer Tali Garsiel. Over a few years, she reviewed all the published data about browser internals and spent a lot of time reading web browser source code. She wrote: 这篇关于WebKit和Gecko内部操作的概述,来自以色列开发者Tali Garsiel多年的研究。近年来,她查阅过几乎所有浏览器内部机制的公开资料,并花费了大量时间阅读Web浏览器的源代码,她写道:

In the years of IE 90% dominance there was nothing much to do but regard the browser as a “black box”, but now, with open source browsers having more than half of the usage share, it’s a good time to take a peek under the engine’s hood and see what’s inside a web browser. Well, what’s inside are millions of C++ lines… 在IE统治世界的年代,“黑盒”一样的浏览器并没有多少操作空间,而如今,开源浏览器们拥有了半壁江山,是时候一睹Web浏览器的冰山之下的世界了。当然,冰山之下的大概是数以百万计的C++代码… Tali published her research on her site, but we knew it deserved a larger audience, so we’ve cleaned it up and republished it here. Tali 在她的网站公开了她的研究内容,但是我们知道,她理应值得更多的观众,于是我们重新整理了这些资料并把它重新发布到这里。

As a web developer, learning the internals of browser operations helps you make better decisions and know the justifications behind development best practices. While this is a rather lengthy document, we recommend you spend some time digging in; we guarantee you’ll be glad you did.

Paul Irish, Chrome Developer Relations

作为一名Web开发者,学习浏览器内部操作帮助你更好的决定和理解最佳实践背后的理由。鉴于本文可能会比较长,建议你花费一点时间来深入阅读,我保证,读完之后你一定会有收获的。 —- Paul Irish, Chrome Developer Relations

介绍

Web browsers are the most widely used software. In this primer, I will explain how they work behind the scenes. We will see what happens when you type google.com in the address bar until you see the Google page on the browser screen. Web浏览器是使用最广泛的软件,在本文中,我将向你解释它在日常场景中是如何运作的。我们也会看到当你在地址栏中输入google.com并真正进入Google页面时,到底发生了什么。

我们将讨论的浏览器

There are five major browsers used on desktop today: Chrome, Internet Explorer, Firefox, Safari and Opera. On mobile, the main browsers are Android Browser, iPhone, Opera Mini and Opera Mobile, UC Browser, the Nokia S40/S60 browsers and Chromeall of which, except for the Opera browsers, are based on WebKit. I will give examples from the open source browsers Firefox and Chrome, and Safari (which is partly open source). According to StatCounter statistics (as of June 2013) Chrome, Firefox and Safari make up around 71% of global desktop browser usage. On mobile, Android Browser, iPhone and Chrome constitute around 54% of usage. 如今,有5大主流桌面端浏览器,它们分别是:Chrome,IE,Firefox,Safari和Opera。而在移动端,主流浏览器则分别是安卓浏览器,iPhone,Opera Mini/Mobile,UC浏览器,诺基亚S40/S60浏览器和Chromeall,除Opera以外,它们都基于WebKit。我将在Firefox,Chrome,Safari(半开源)这些开源浏览器中给出例子。根据StatCounter statistics 2013年6月的统计,Firefox,Chrome,Safari共拥有71%的桌面端占有率,移动端上安卓浏览器,iPhone,Chrome则是54%的占有率。

Licensed under CC BY-NC-SA 4.0
Built with Hugo
主题 StackJimmy 设计