Frontend Labs
⋯
🟨

Browser Lab — full source

The complete, tested source of Browser Lab, generated from the files in JS/projects/browser-lab/ by build-source-pages.mjs. 26 files.

29 chapters · 1 h 18 min of reading

A live, animated tour of how the browser and the JavaScript engine work, built with plain JavaScript and CSS (no framework, no build step, no runtime dependencies). It is Capstone II of the JavaScript field guide (§79–§84).

Nine stations, each with missions that tick themselves off:

Station What's live
00 The big picture process/thread map, an animated "life of a click", your browser's capabilities
01 URL to bytes Navigation Timing, an HTTP/1.1 vs HTTP/2 request burst, TLS 1.3 vs 1.2, ALPN/cipher, SSE
02 Rendering pipeline stages per CSS property, layout thrashing measured, DOM vs render tree
03 Event loop step-through simulator, prediction quiz, verified against the real engine
04 Inside V8 tier-up/deopt, real bytecode, hidden classes, inline caches, megamorphic benchmark
05 Threads visible jank, Web Worker fix, copy vs transfer, SharedArrayBuffer race vs Atomics
06 Storage IndexedDB events as they fire, the auto-commit pitfall, sync vs async storage
07 Core Web Vitals live LCP/INP/CLS gauges, break and fix CLS and INP, Long Animation Frames
08 Debugging captured errors/rejections/CSP violations, a findable leak, User Timing, DevTools recipes

Contents

29 chapters, one page each. Prefer one long page? Read the whole book on one page.

  1. Run it1 min
  2. Test it1 min
  3. Files1 min
  4. package.json1 min
  5. server.mjs3 min
  6. scripts/cert.mjs1 min
  7. public/index.html1 min
  8. public/css/lab.css10 min
  9. public/js/lib/dom.js2 min
  10. public/js/lib/errors.js1 min
  11. public/js/lib/loop-model.js3 min
  12. public/js/lib/missions.js2 min
  13. public/js/lib/primes.js1 min
  14. public/js/lib/vitals.js2 min
  15. public/js/main.js2 min
  16. public/js/stations/debug.js4 min
  17. public/js/stations/engine.js7 min
  18. public/js/stations/eventloop.js7 min
  19. public/js/stations/network.js7 min
  20. public/js/stations/overview.js4 min
  21. public/js/stations/render.js5 min
  22. public/js/stations/storage.js4 min
  23. public/js/stations/threads.js5 min
  24. public/js/stations/vitals.js5 min
  25. public/js/workers/counter.js1 min
  26. public/js/workers/echo.js1 min
  27. public/js/workers/primes.js1 min
  28. playwright.config.js1 min
  29. tests/lab.spec.js3 min

Generated from SOURCE.md · 8 Oct 2026 16:36