GitHub - pdufour/browserbrowserbrowser: Rust browser running inside a browser via WASM / WGPU

1 min read Original article ↗

browserbrowserbowser

This demo was done because an LLM told me it couldn't be done. And because everything that is anything must be written in Rust.

How is it done, who cares, let's see a video:

output.mp4

Okay but really how does it work.

Architecture

wasm-pack builds a wasm binary that call out to Servos APIs: html5ever and stylo, sometimes directly sometimes through Blitz APIs. Servo understands CSS and HTML and renders the page to an image via Vello which is a WebGPU renderer.

You can see WASM support #160 for the inception of this project.

Running project

Requirements

  • Rust — see rust-toolchain.toml (wasm32-unknown-unknown).
  • wasm-pack
  • CORS — fetched pages must be allowed; the stock URL box expects wrappers like https://corsproxy.io/?https://….
wasm-pack build --target web --out-dir web/pkg
cargo run --bin serve-web

Then open http://127.0.0.1:8080/