Tools

Firefox compiled to WebAssembly runs inside another browser

Puter compiled Firefox (Gecko) into WebAssembly so the entire browser can run inside a different browser, demonstrated by running a Firefox instance in WebAssembly inside Chrome.

Firefox compiled to WebAssembly runs inside another browser

The Puter project compiled Firefox into WebAssembly (WASM) so the entire browser can run inside a different browser. The demonstration showed the developer’s blog running in Firefox, with that Firefox instance itself compiled to WebAssembly and executing inside, for example, Chrome.

Technical choices and rationale

The team chose the Firefox/Gecko codebase because its strong single-process support made the build and runtime model easier to manage in this context. Compiling the browser engine to WebAssembly enables a native browser engine to run inside a host browser’s JS/WASM environment.

Network proxying and security

The demo channels all network traffic over a WebSocket-based connection to Puter’s server, using the Wisp protocol. This proxying is required because code running inside browsers cannot open arbitrary network connections, so the WebSocket proxy is necessary for the current approach.

Puter claims the setup supports end-to-end encryption. An inspection of the WebSocket messages showed that traffic to an HTTPS site was encrypted over the proxy, while requests and responses to http://www.example.com/ appeared in cleartext.

Costs and scaling

The project was funded with an estimated $25,000 worth of Claude Opus and Fable tokens, leveraging a Claude Max subscription plan. The Puter team reported that they had to scale up servers to handle increased traffic driven by the Hacker News discussion about the project, which added additional load and costs.

Source code and related projects

The firefox-wasm repository is publicly available from the Puter project. A related effort, theogbob/WebkitWasm, compiles WebKit to WASM, but that project currently does not have an accessible online demo.

Why this matters

Compiling Firefox to WebAssembly is a notable technical demonstration of running complex native code inside the browser despite platform limits. Potential use cases include research, education, sandboxing and compatibility testing. At the same time, reliance on a network proxy and the associated operational costs highlight practical barriers to broader deployment.


Sources and further reading

  • Puter’s firefox-wasm repository and demonstration
  • theogbob/WebkitWasm project
  • Hacker News discussion that increased server traffic

(Summary based on publicly shared project details and the demonstration observations.)