Status: ✅ COMPLETE

Scope: What a web browser really is inside: its processes, how it draws a page, how it runs JavaScript, how it talks to the network, what it stores and how it keeps sites apart
Time to complete: 90–120 minutes of reading + lab
Prerequisites: Chapter 9 (Processes), Chapter 10 (Threads), Chapter 27 (How Networking Actually Works), Chapter 28 (Windows Networking Internals)
What you'll know after: Why your browser shows many chrome.exe or msedge.exe processes, how HTML becomes pixels, why a long script freezes a tab, what happens from typing a URL to seeing the page, and how cookies, storage and the same-origin policy work


INTRODUCTION

For most people the browser is the program they use most. It is also one of the most complex programs on the PC: close to a small operating system. It runs untrusted code from strangers, talks to the network, draws graphics and stores your private data, all at once. So it is built like a secure building with many locked rooms.

This chapter uses plain words and ASCII diagrams, plus two real pictures (a router and a packet capture). Every technical term is explained the first time it appears. We describe Chromium (the engine of Chrome and Edge) most closely, and say where Firefox and Safari differ.

This chapter explains:

  • The multi-process design: browser, renderer, GPU and network processes, and why they are separate
  • How the rendering engine turns HTML and CSS into a DOM, a render tree, layout, paint and GPU layers
  • How the JavaScript engine compiles code, and how the event loop works on one main thread
  • URLs, DNS, TCP and QUIC, TLS, HTTP versions, status codes, headers and caching
  • Cookies, localStorage, sessionStorage, IndexedDB and caches, and how to clear them
  • The same-origin policy, CORS, and (defensively) XSS and CSRF
  • The complete chain from typing a URL to pixels on the screen
  • A safe, read-only lab with the browser Task Manager and DevTools

CHAPTER OUTLINE


Chapter Status: Complete
Estimated reading time: 100 minutes
Practical time: 30 minutes
Knowledge check time: 30 minutes