firefox-html

firefox.html

firefox.html is one file that contains the real Gecko engine and Firefox front-end from HeyPuter/firefox-wasm, built from source and embedded as Base64. Double-click it: Firefox starts inside the page. Nothing to install, run or serve.

File Purpose
firefox.html The single-file browser (80,325,334 bytes).
build.sh Reproducible build on Linux (Ubuntu 24.04).
build.ps1 The same build from PowerShell. On Windows it runs build.sh inside WSL 2; on Linux it calls it directly.
resources/ What the build scripts use: the packer, the page source (src/) and the engine patches (patches/).

Report

Question Answer
Did the real Firefox engine build? Yes. Gecko 153.0a1 compiled with emscripten 6.0.1 and Rust 1.95.0, plus the two patches in resources/patches. Build ID 20261103131955.
Final HTML size 80,325,334 bytes (76.6 MiB).
Does it work from file://? Yes. Opened from disk with no browser flags, Firefox boots in about 5 to 7 s (Chrome 153).
Does it require a local server? No. Served from a web server it also works, with or without the two COOP/COEP headers. With them it uses real multi-threading.
Which features work? See “Tested” below.

How it runs from a file

Gecko is multi-threaded: 40 to 55 pthreads share one block of WebAssembly memory. Normally each thread is a Web Worker, and browsers only let a page hand its shared memory to Workers when the page is cross-origin isolated, which a file opened from disk never is. So when that hand-off isn’t allowed, this build doesn’t use Workers at all:

When the page is cross-origin isolated (served with the two headers), the same file uses real Workers on all CPU cores instead.

Tested

Chrome 153 (headless), firefox.html opened as file:// with no command-line flags, so not cross-origin isolated:

Doesn’t work / limitations:

Not tested:

Sharing on Discord: the file is 76.6 MiB. Discord’s upload limit without Nitro is 10 MB, so post it with Nitro (which allows larger uploads) or share a link from a file host. The engine alone is 37 MB compressed, so a working build can’t get under 10 MB.

Building an update

Linux (Ubuntu 24.04, about 35 GB of disk, 16 GB of RAM)

./build.sh
Stage What it does
deps apt packages (including Node.js), Rust 1.95.0 with rust-src and wasm32-unknown-emscripten, cbindgen 0.29.4, pnpm
clone Clones firefox-wasm at the pinned commit into work/
engine Runs upstream’s make emsdk firefox vendor, applies resources/patches, then make web and make chrome-assets
pack Writes firefox.html

./build.sh pack alone re-packs. FIREFOX_WASM_REF=<commit> builds another upstream version; if the patches no longer apply to it, the build stops and says which one.

Windows (PowerShell)

  1. Once, in an administrator PowerShell: wsl --install -d Ubuntu-24.04. Open Ubuntu once to create your Linux user.
  2. On a 16 GB PC, put this in %UserProfile%\.wslconfig, then run wsl --shutdown:
    [wsl2]
    memory=12GB
    swap=16GB
    
  3. Run powershell -ExecutionPolicy Bypass -File .\build.ps1, or for example .\build.ps1 pack for one stage.

The engine patches (resources/patches)

The page side is in resources/:

What the build does (phases 1 to 4)

Licenses

Gecko, the Firefox front-end and firefox-wasm are MPL-2.0. The bundled wisp-js client is AGPL-3.0, zstddec is MIT, and the icons are Lucide (ISC). The full texts are at the bottom of firefox.html, and Gecko’s third-party licenses are at about:license. This is an unofficial build; Firefox is a trademark of the Mozilla Foundation.