Skip to main content
SerenityOS features a fully custom web browser built entirely from scratch, including the HTML/CSS rendering engine (LibWeb) and JavaScript engine (LibJS). The browser demonstrates impressive web standards compliance and continues to improve rapidly.

Overview

The Browser application is a multi-process, sandboxed web browser that brings modern web capabilities to SerenityOS’s retro-inspired interface.

Web Standards

HTML5, CSS3, JavaScript ES2023+, WebAssembly support

Security First

Multi-process architecture with aggressive sandboxing

From Scratch

No external dependencies - built entirely in-house

Spec Compliant

Actively tracking web standards with test suite integration

Standards Compliance

The Browser and LibWeb track the latest web standards with impressive compliance:
The browser passes a significant and growing portion of the official web platform test suites, demonstrating serious standards compliance.

Multi-Process Architecture

Process Isolation

The Browser uses a sophisticated multi-process architecture for security and stability:
┌─────────────┐
│   Browser   │  (GUI Process)
│   Process   │
└──────┬──────┘

       │ spawns per-tab

┌─────────────┐
│ WebContent  │  (Rendering & JS)
│   Process   │
└──────┬──────┘

       ├──────► RequestServer (Network)

       └──────► ImageDecoder (Image Processing)

Process Types

The main GUI application process that:
  • Manages the browser window and UI
  • Handles user input and navigation
  • Spawns and manages WebContent processes
  • Runs with normal user privileges
  • Provides tab management
Sandboxed rendering engine that:
  • Runs LibWeb (HTML/CSS engine)
  • Executes JavaScript via LibJS
  • Renders web pages to shared bitmaps
  • Runs as an unprivileged user
  • One process per tab for isolation
  • Cannot access network or files directly
  • Strictly sandboxed with pledge() and unveil()
Network request handler that:
  • Handles HTTP, HTTPS, and Gemini protocols
  • Manages cookies and cache
  • One instance per WebContent process
  • Sandboxed network access only
  • Cannot read arbitrary files
Isolated image decoding that:
  • Decodes images in separate processes
  • Fresh process for each image
  • Extremely restricted sandbox
  • Memory-safe implementations
  • Prevents image parsing vulnerabilities
All processes except the main Browser run as an unprivileged user, separate from the logged-in desktop user, providing defense in depth.

LibWeb - The Rendering Engine

LibWeb is the from-scratch HTML/CSS rendering engine that powers the browser.

Core Components

HTML Parser
  • HTML5 compliant parsing
  • Error recovery and tolerance
  • Streaming parser implementation
  • Fragment parsing support
CSS Engine
  • CSS3 selector support
  • Cascade and inheritance
  • Layout algorithms (Block, Inline, Flex, Grid)
  • CSS animations and transitions
  • Media queries
  • CSS custom properties (variables)
Layout Engine
  • Box model implementation
  • Flexbox layout
  • CSS Grid layout
  • Inline and block formatting contexts
  • Positioning (static, relative, absolute, fixed, sticky)
  • Text layout and shaping
Rendering
  • Hardware-accelerated painting
  • Layered composition
  • Stacking contexts
  • Overflow handling
  • Clipping and masking

Document Object Model (DOM)

Full DOM implementation with:
  • DOM Level 4 APIs
  • Event system and bubbling
  • MutationObserver
  • Custom elements support
  • Shadow DOM
  • DOM traversal APIs

Web APIs

Extensive Web API support including:

Canvas API

2D drawing context with shapes, text, and images

WebGL

OpenGL ES 2.0 based 3D graphics API

Fetch API

Modern network request API

Web Storage

localStorage and sessionStorage

IndexedDB

Client-side database storage

Web Workers

Background JavaScript execution

WebSockets

Bidirectional communication

SVG

Scalable Vector Graphics rendering

LibJS - The JavaScript Engine

LibJS is a modern JavaScript engine built from scratch.

Language Support

ECMAScript Compliance
  • ES2023+ features
  • Strict mode
  • Modules (ESM)
  • Classes and inheritance
  • Async/await
  • Generators and iterators
  • Proxy and Reflect
  • WeakMap and WeakSet
  • Symbols
  • BigInt
  • Template literals

Engine Architecture

Bytecode Compilation
  • AST to bytecode compiler
  • Bytecode interpreter
  • Optimization passes
  • Efficient instruction set
Runtime Features
  • Garbage collection
  • Exception handling
  • Lexical scoping
  • Closures
  • Prototypal inheritance
  • Property descriptors

Performance

  • Optimizing compiler in development
  • Inline caching for property access
  • Efficient object representation
  • Fast array operations
  • String interning

WebAssembly Support

The browser includes a WebAssembly implementation:
  • Wasm binary format parsing
  • Wasm text format (WAT) support
  • WebAssembly instantiation API
  • Memory management
  • Table operations
  • Growing spec compliance
Check the Wasm test results for current specification compliance.

Browser Features

User Interface

  • Tab management
  • Bookmarks
  • History
  • Downloads manager
  • Inspector/DevTools (in development)
  • Page search
  • View source
  • Cookie management
  • Custom user agent
  • Back/forward navigation
  • Page reload
  • Stop loading
  • URL bar with suggestions
  • Home page configuration
  • New tab page

Settings & Privacy

  • Cookie policy configuration
  • JavaScript enable/disable
  • Popup blocking
  • Content filtering
  • Cache management
  • Privacy controls

Developer Tools

The browser includes developer tools for web development:
  • DOM inspector
  • Console for JavaScript debugging
  • Network request monitoring
  • Style inspector
  • JavaScript debugger (in development)

Supported Protocols

HTTP

HTTP/1.1 with Keep-Alive

HTTPS

TLS 1.2 and 1.3 support

Gemini

Alternative internet protocol

File

Local file viewing

Data URLs

Inline data encoding

About

Browser information pages

Security Features

The Browser implements multiple layers of security:

Sandboxing

  • pledge() system call restrictions per process
  • unveil() file system access controls
  • Process privilege separation
  • Memory protection (W^X)

Network Security

  • State-of-the-art TLS algorithms
  • Certificate validation
  • HTTPS enforcement options
  • Secure cookie handling
  • CORS implementation

Content Security

  • Content Security Policy (CSP)
  • Same-Origin Policy
  • X-Frame-Options support
  • Subresource Integrity (SRI)
  • Mixed content blocking

Process Isolation

  • Per-tab isolation prevents cross-tab attacks
  • Unprivileged rendering processes
  • Isolated image decoding
  • Separate network access layer
The multi-process architecture ensures that a compromised tab cannot affect other tabs or access system resources.

File Format Support

The browser can display numerous file formats: Images: PNG, JPEG, GIF, BMP, ICO, SVG, QOI, WebP Documents: HTML, XML, Markdown (rendered), Plain text, PDF Media: Audio and video through LibMedia Other: JSON (formatted), Source code (syntax highlighted)

Development & Testing

The browser is actively developed with:
  • Continuous integration testing
  • Web Platform Tests (WPT) integration
  • Test262 for JavaScript compliance
  • Fuzzing with OSS-Fuzz
  • Regular spec updates
  • Community contributions
The Browser and LibWeb serve as the foundation for Ladybird, a cross-platform browser built on SerenityOS technology.

Learn More

For technical details about the browser architecture:
  • Process Architecture: Documentation/Browser/ProcessArchitecture.md
  • LibWeb Rendering Pipeline: Documentation/Browser/LibWebFromLoadingToPainting.md
  • Browsing Contexts: Documentation/Browser/BrowsingContextsAndNavigables.md

Build docs developers (and LLMs) love