Skip to main content

Crate oxide_browser

Crate oxide_browser 

Source
Expand description

§Oxide Browser — Host Runtime

oxide-browser is the native desktop host application for the Oxide browser, a binary-first browser that fetches and executes .wasm (WebAssembly) modules instead of HTML/JavaScript.

§Architecture

┌──────────────────────────────────────────────────┐
│                   Oxide Browser                  │
│  ┌──────────┐  ┌────────────┐  ┌──────────────┐  │
│  │  URL Bar │  │   Canvas   │  │   Console    │  │
│  └────┬─────┘  └──────┬─────┘  └──────┬───────┘  │
│       │               │               │          │
│  ┌────▼───────────────▼───────────────▼───────┐  │
│  │              Host Runtime                  │  │
│  │  wasmtime engine + sandbox policy          │  │
│  │  fuel limit: 500M  │  memory: 16MB max     │  │
│  └────────────────────┬───────────────────────┘  │
│                       │                          │
│  ┌────────────────────▼───────────────────────┐  │
│  │          Capability Provider               │  │
│  │  "oxide" import module                     │  │
│  │  canvas, console, storage, clipboard,      │  │
│  │  fetch, images, crypto, base64, protobuf,  │  │
│  │  dynamic module loading, audio, timers,    │  │
│  │  navigation, widgets, input, hyperlinks    │  │
│  └────────────────────┬───────────────────────┘  │
│                       │                          │
│  ┌────────────────────▼───────────────────────┐  │
│  │           Guest .wasm Module               │  │
│  │  exports: start_app(), on_frame(dt_ms)     │  │
│  │  imports: oxide::*                         │  │
│  └────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────┘

§Modules

ModulePurpose
engineWasmtime engine configuration, sandbox policy, memory bounds
runtimeModule fetching, compilation, execution lifecycle
capabilitiesAll host-imported functions exposed to guest wasm modules
navigationBrowser history stack with back/forward traversal
bookmarksPersistent bookmark storage backed by sled
urlWHATWG-compliant URL parsing with Oxide-specific schemes
uiegui/eframe desktop UI (toolbar, canvas, console, tabs)

§Security Model

Every guest .wasm module runs in a strict sandbox:

  • No filesystem access — guests cannot read or write host files
  • No environment variables — guests cannot inspect the host environment
  • No raw sockets — all network access is mediated through fetch
  • Bounded memory — 16 MB (256 pages) hard limit
  • Fuel metering — 500M instruction budget prevents infinite loops
  • Capability-based I/O — only explicitly provided oxide::* functions are available to the guest

Modules§

bookmarks
Persistent bookmarks for the Oxide browser.
capabilities
Host capabilities and shared state for WebAssembly guests.
engine
WebAssembly engine configuration for Oxide.
navigation
Navigation history stack for the Oxide browser.
runtime
Guest WebAssembly lifecycle for the Oxide browser.
ui
Desktop GUI for Oxide using egui and eframe.
url
WHATWG URL Standard compliant URL parsing for the Oxide browser.