5 ms·
Show HN: Firefox in WebAssembly
This is the entire Firefox browser rendering to a <canvas> element. Gecko, all UI components, and the Spidermonkey JS engine are all compiled and running in WebAssembly.
Here are a few things you might find interesting:
- This is fully end to end encrypted! We use the WISP protocol for TCP-over-websockets.
- There is a novel WASM->JS JIT for experimental site speedup
- This port cost over 25k in opus/fable tokens for debugging and JIT research
This was just a fun experiment to push the boundaries of WebAssembly. For a more usable "browser in browser" experience, we also built https://github.com/HeyPuter/browser.js https://github.com/HeyPuter/browser.js that eats a bit less RAM.
- chews 3mo agoYo dog, I heard you like browsers, so I put a browser in your browser.
- throwaway2027 3mo agoObligatory https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- rlmineing_dead 3mo agoI had this in mind when I first saw this project too LOL Every year I need to rewatch this talk
- mdlxxv 3mo ago"Yo dawg. I herd you like web browsers, so I put a browser in your browser, so you can browse the Web while you browse the Web".
- ent101 3mo agoshould've used this in the splash screen :(
- eqrion 3mo ago> There is a novel WASM->JS JIT for experimental site speedup I would love to see the details for this. SpiderMonkey had an attempted wasm32 JIT backend, but it was never finished. edit: Apparently it also has some sort of WebAssembly interpreter backend too, which SpiderMonkey doesn't have.
- dima00782 3mo ago+1 from me, as I'm the author of the wasm32 JIT backend. I guess the direction is wrong, it should be JS JIT -> WASM, right? or maybe I don't understand the scheme.
- som 3mo ago... doesn't support Firefox mobile apparently :D
- rlmineing_dead 3mo agoDoes firefox mobile (Android, since firefox mobile iOS is a WebKit wrapper) support about:config settings? if so you can enable wasm_js_promise_integration in about:config and have it working likely. I will test this on my Pixel 10 pro
- rlmineing_dead 3mo agohi reporting back, yes stock firefox mobile wont work but the BETA version will because it just added the WASM feature needed (firefox 153 adds it but regular mobile firefox lacks about:config support it seems) and by "will work" I mean will render the first frame and then freeze YMMV
- coolelectronics 3mo agoOh and for anyone asking, you can run firefox-wasm inside firefox-wasm inside firefox! I only got this to load once though since it gets pretty unstable at that level.
- sanex 3mo agoYo dawg I heard you like Firefox.
- csomar 3mo agoI couldn't get it to work. The whole thing froze.
- preisschild 3mo agoIts the first thing I tried as well :D
- degamad 3mo agoI'm so glad this exists, I've been considering doing something like this for a few months. I recently got a TV based on VIDAA os, a locked-down linux-based OS where everything is rendered from Web pages. It has a built-in browser that doesn't support ad-blocking (I suspect VIDAA is profiting from showing ads on the TV), and you can't install new apps unless they're Web pages. This would hopefully allow one to run Firefox within the existing browser, then install uBlock Origin within Firefox... I know what this weekend's project is going to be...
- coolelectronics 3mo agoWe also plan on adding extension support to https://github.com/HeyPuter/browser.js https://github.com/HeyPuter/browser.js soon, which should hopefully cover use cases like that as well without the full overhead
- shevy-java 3mo agoFirefox should really bundle ublock origin as-is. I install it afterwards anyway but I don't understand Mozilla here. They seem to want to stay behind Google.
- quantummagic 3mo agoIn 2024, "search royalties" brought in approximately $585 million for Mozilla, largely from Google. It's not hard to see why they tread very lightly around ad blocking. It's actually impressive that ublock remains easy and painless to install as an extension.
- Sabinus 3mo agoWouldn't the whole point of Google propping up competition browsers to avoid antitrust be completely undermined if Google was influencing the development of said browsers?
- BobbyTables2 3mo ago
- MajesticHobo2 3mo agoBrowser sandboxing is now fully solved.
- yjftsjthsd-h 3mo agoIn mean... It kinda feels like this is legitimately true? An attacker trying to do anything on a user's machine through this would have to find a Firefox vulnerability and a vulnerability in the wasm runtime, which is such a high bar that I would actually feel remarkably safe running this thing. The only question is how performance works and whether there are any pain points using as a daily driver, but those feel likely to be a pretty minor point. Oh, and the usual caveat that an attacker can still compromise things inside the sandbox which does leave a certain amount of exposure (but if you run different things in different instances they're isolated).
- rlmineing_dead 3mo agoThis is true but also this is probably also only half true. Sandboxing is not a fully solved issue since this 100% degrades firefox sandboxing since fission cant run and its running in singleprocess mode. Just wanted to be honest about this
- Retr0id 3mo agoAssuming you're running Firefox as the outer browser too, in theory it only needs a single bug in the wasm runtime, plus a sandbox escape.
- coolelectronics 3mo agoUnless you're running every origin in a different instance, I wouldn't use this as a daily driver, since a site would only need to find a renderer vuln to be able to read the rest of your cookies as multiprocess isolation is disabled here
- one33seven 3mo agoYou are forgetting that this is largely edited by AI as a fun project. Finding a bug in that firefox probably is a lot easier than usual.
- deleted 3mo ago[deleted]
- azakai 3mo agoPrior art: WebKit.js, the WebKit rendering engine ported to JS https://github.com/trevorlinton/webkit.js/ https://github.com/trevorlinton/webkit.js/
- deleted 3mo ago[deleted]
- sangeeth96 3mo agoedit: I misunderstood, that's $25k not 25k tokens :/ time to log off. this is so rad! 25k tokens is a lot less than i thought this'd take -- what were the difficult bits in the porting process? also, was firefox preferred because parts of it are already in rust?
- coolelectronics 3mo ago$25k of tokens, closer to 30 billion I believe. It only took a few days to actually get the engine up, the hard parts where most of the effort was spent was squeezing out performance and increasing stability, as well as attempting the JIT. Firefox was chosen because its single-process support was in a better place than chromium/blink. WebKit is also possible, it was done by a friend of mine earlier https://github.com/theogbob/WebkitWasm https://github.com/theogbob/WebkitWasm
- sangeeth96 3mo agoah, i misunderstood. that seemed way too low in terms of actual tokens lol. i'll log off now. interesting details and didn't know about WebkitWasm. hope to read more soon.
- ohonbob 3mo agoSince coolelectronics posted his firefox wasm here ill post my sideproject (we worked on these around the same time), Webkit In WebAssembly (And actually modern and usable! Unlike the older trevorlinton/webkit.js project) https://github.com/theogbob/WebkitWasm https://github.com/theogbob/WebkitWasm Not as polished as the firefox port but is a fully working port of webkit ported with fable, opus and some glm 5.2.
- jedisct1 3mo ago"This browser doesn't support WebAssembly JSPI, which Firefox WASM needs to run."
- rlmineing_dead 3mo agosafari? I think its going to be added in 27
- stuaxo 3mo agoI get this on Firefox on Android.
- zerof1l 3mo agoAll the network traffic from that browser is routed through a server. My IP inside that browser was in India and on CloudFlare network. I don’t particularly trust Puter. Why not route traffic through my actual browser?
- ent101 3mo agoPuter's networking is open-source and e2e encrypted. Also, a regular browser doesn't give access to raw TCP sockets used for this, so it wouldn't be possible to route through your browser.
- gnabgib 3mo agoSo it's just the three accounts you have now? (Show by @coolelectronics now and 7 months ago [1], show from you/@ent101 2d ago [0], 2025[2,3,4], 2024[5,6,7,8,9,A,B,C,D], 2023[E], @george0812 2022[F]) [0]: https://news.ycombinator.com/item?id=48895945 https://news.ycombinator.com/item?id=48895945 [1]: https://news.ycombinator.com/user?id=coolelectronics https://news.ycombinator.com/user?id=coolelectronics [2]: https://news.ycombinator.com/item?id=45522061 https://news.ycombinator.com/item?id=45522061 [3]: https://news.ycombinator.com/item?id=44193514 https://news.ycombinator.com/item?id=44193514 [4]: https://news.ycombinator.com/item?id=42675696 https://news.ycombinator.com/item?id=42675696 [5]: https://news.ycombinator.com/item?id=41849494 https://news.ycombinator.com/item?id=41849494 [6]: https://news.ycombinator.com/item?id=41682779 https://news.ycombinator.com/item?id=41682779 [7]: https://news.ycombinator.com/item?id=41360683 https://news.ycombinator.com/item?id=41360683 [8]: https://news.ycombinator.com/item?id=41040761 https://news.ycombinator.com/item?id=41040761 [9]: https://news.ycombinator.com/item?id=40802253 https://news.ycombinator.com/item?id=40802253 [A]: https://news.ycombinator.com/item?id=39829463 https://news.ycombinator.com/item?id=39829463 [B]: https://news.ycombinator.com/item?id=39672886 https://news.ycombinator.com/item?id=39672886 [C]: https://news.ycombinator.com/item?id=39597030 https://news.ycombinator.com/item?id=39597030 [D]: https://news.ycombinator.com/item?id=39036897 https://news.ycombinator.com/item?id=39036897 [E]: https://news.ycombinator.com/item?id=38202220 https://news.ycombinator.com/item?id=38202220 [F]: https://news.ycombinator.com/item?id=31611016 https://news.ycombinator.com/item?id=31611016
- yjftsjthsd-h 3mo ago>This port cost over 25k in opus/fable tokens for debugging and JIT research > This was just a fun experiment to push the boundaries of WebAssembly I'm a huge fan of the project, but I have to ask. If spending $25k is a "fun experiment", where exactly is your threshold for serious work?
- tiagod 3mo agoWas it really $25k, or was it done though subscriptions with a reported cost of $25k? I'm on the openai $100 sub and frequently my codexbar will show $250 usage in a day. I think it probably doesn't have access to the cached token share too, which probably inflates that a lot.
- rlmineing_dead 3mo agoThe latter
- smalltorch 3mo agoI imagine it is 25k tokens not dollars
- rustyhancock 3mo agoThat's standard token usage for /init
- yjftsjthsd-h 3mo agohttps://news.ycombinator.com/item?id=48927724 https://news.ycombinator.com/item?id=48927724 seems to say dollars? Although yes the phrasing could be clearer in the post
- smalltorch 3mo agoWell that's a lot of money. Cheap considering what that may have cost a few years ago I suppose.
- 3mo ago
- brewmarche 3mo agoCan’t get it running on Firefox 152.0.6 (aarch64), no extensions. [chrome-demo] chrome assets ready [gecko] warning: unsupported syscall: __syscall_madvise [gecko] embed-xul: main() on the app pthread (PROXY_TO_PTHREAD) [gecko] embed-xul: GECKO_GL_PASSTHROUGH=1 [gecko] embed-xul: GECKO_COARSE_CLOCK=1 [gecko] embed-xul: GECKO_GPU=1 (GPU/WebRender->canvas rendering) [gecko] xul_init: GRE dir = /gre [gecko] Pthread 0x11051000 sent an error! blob:https://developer.puter.com/edc1bd0a-b844-4a18-a69a-63dd49dc304a:8906: SecurityError: Security error when calling GetDirectory
- rlmineing_dead 3mo agoRunning firefox on aarch64 here right now (Ubuntu 26.04 ARM on snapdragon X1E) did you enable the about:config option? it may be required
- brewmarche 3mo agoYes, you don’t get that far without it.
- rlmineing_dead 3mo agoWhat's your GPU driver? There's a good chance this is a bug with the GPU passthrough. You can fall back to software rendering in the advanced options while it's starting if you want to try
- simonw 3mo agoThis is amazing. I loaded up https://developer.puter.com/labs/firefox-wasm/ https://developer.puter.com/labs/firefox-wasm/ in Chrome and I've visited a bunch of sites, it works really well. Then I opened up https://developer.puter.com/labs/firefox-wasm/ https://developer.puter.com/labs/firefox-wasm/ in Firefox-in-WebAssembly-in-Chrome ... and sadly it didn't load. I got this in the startup log: [log] [chrome-demo] chrome assets ready [warn] [gecko] warning: unsupported syscall: __syscall_madvise
- SpyCoder77 3mo agoNo mobile support
- rlmineing_dead 3mo agoYeah I seem to see that it does crash on Firefox mobile, (well first frame loads) and on chrome mobile it doesn't seem to load at all (complaining about running out of memory in a small pop-up) Pixel 10 pro user here
- koolala 3mo agoWhat makes it require that WASM extension you need the flag for in Firefox? Was there really no way to work around it or polyfill it for it to work? It is performance critical?
- deleted 3mo ago[deleted]
- coolelectronics 3mo agoIt is required in order to yield the event loop and force an implicit sync on OffscreenCanvas. There is technically a slower workaround for this but JSPI is coming soon anyway to firefox 153 and safari 27.
- elmer2 3mo agoI would be careful with this demo. When you go to whatismyip.com, it's showing: 104.28.233.73. Someone could use this to cloak their IP address and do some damage.
- haddr 3mo agoI think they had to solve the TCP connection, as normally you can't easily implement TCP sockets in WASM. So I suppose they just need to tunnel all the connection through some websocket.
- rlmineing_dead 3mo agoCan concur, we use a proxy based on the wisp protocol to efficiently proxy TCP packets over websocket
- andai 3mo agoThe description mentions a similar project browser.js which apparently has some real use cases, what are they?
- deleted 3mo ago[deleted]
- luciana1u 3mo ago[flagged]
- koolala 3mo agoI think it was $25,000...
- EvanAnderson 3mo agoI've been waiting for this to happen. The websites that don't want you to block ads will serve you an obfuscated "inner browser" that will render their site. All your ad blockers, etc, are rendered moot. Once accessibility is solved this is absolutely going to be a thing on major websites.
- compass_copium 3mo agoGreat, looking forward to needing 16GB RAM to watch youtube :(
- rlmineing_dead 3mo agoAssumes bad actors care about accessibility in the first place
- lukan 3mo agoIf ublock origin guards the connections above, ads still won't load. (Except embedded ads, that also show now)
- EvanAnderson 3mo agoThe future product will tunnel all the connections from the inner browser over an opaque pipe (like WebSockets) with the encryption handled by the inner browser (and using cert. pinning).
- rlmineing_dead 3mo agoThis is already possible (actually because of a related project, https://github.com/ading2210/libcurl.js/ https://github.com/ading2210/libcurl.js/ ) which compiles... I think WolfSSL or mbedTLS and libcurl to the wasm and then uses the same TCP proxy protocol we're using here (wisp) to tunnel HTTPS over a websocket connection securely and opaquely.
- rmac 3mo agoon mobile chrome / Android I can't get the following to work : - IME / keyboard doesn't pop on any field - copy paste - scrolling with touch - ai side panel What works on mobile : - Extensions ! This is so sick great work; did you try webgpu? https://imgur.com/a/nWFCraP https://imgur.com/a/nWFCraP
- ksmithbaylor 3mo agoI can’t help but think of Gary Bernhardt’s 2014 talk, “The Birth and Death of JavaScript”: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- lxe 3mo agoIt's kind of ironic how this doesn't work in Firefox.
- jagged-chisel 3mo agoOn what platform? Works here. macOS Tahoe 26.5.2 (25F84) Firefox 152.0.5 (aarch64) EDIT: Updated, still works on Firefox 152.0.6 (aarch64)
- koolala 3mo agoWorked in my Firefox on Steam Deck. I was amazed it could run YouTube.
- rlmineing_dead 3mo agoSo funny story, supporting web codecs may have been a bad idea because it led to people using more traffic per session than we assumed at first. We had to add more servers mid HN post We had completely saturated NICs on like the two original servers
- pmarreck 3mo agoIt worked for me but I had to enable something in about:config javascript.options.wasm_js_promise_integration
- l1ng0 3mo agoGreat, now I can finally make an Electron.js application with code made for Firefox!
- pmarreck 3mo agoImpressive and surprisingly performant, but what's the use-case? If anything, this is an ad for WASM!
- rlmineing_dead 3mo agoThis is a fun browser demo to show how far we've come in terms of browser technology mostly
- tech234a 3mo agoLoosely related to porting the Firefox engine in unusual places: here is a project that ports Firefox's Gecko rendering engine to iOS as a sideloadable app (normally Apple only allows its own WebKit rendering engine in iOS apps): https://github.com/minh-ton/reynard-browser https://github.com/minh-ton/reynard-browser
- rlmineing_dead 3mo agoStarred, very cool!
- The_SamminAter 3mo agoIndeed. This is both the best and the only actively maintained way for older versions of iOS to use modern js.
- ksdme9 3mo agofun how this doesn't work on my firefox
- bawolff 3mo ago> This is fully end to end encrypted! We use the WISP protocol for TCP-over-websockets. Umm, that doesn't sound right. By definition, i dont think you can be end2end encrypted in a web browser, since your server controls what code is run by the web browser. Puter would fully be able to spy on you if they were so inclined because they control what wasm you load.
- rlmineing_dead 3mo agoYou can inspect the wasm binary, we can't take that ability away from you (or you can compile using the sources we provide on GitHub and see it provides the same result, it's actually built from an actions runner anyways) End to end Encrypted is valid here because both peers of the request (client and server) have their information being exchanged through TLS and they both manage their own keys. We can't look inside the TLS tunnel, we only transport the TCP side. It's end to end encrypted in the same sense that when you go to hackernews your ISP can't see your password because of TLS. The peer you are requesting has ensured only you can see the data, not any intermediary (Unlike in http where it's completely plain text or a corsproxy where all data is visible to the proxy).
- bawolff 3mo ago> We can't look inside the TLS tunnel, we only transport the TCP side. But you could if you were malicious, you control the tunnel creation code. > It's end to end encrypted in the same sense that when you go to hackernews your ISP can't see your password because of TLS. But its not like that. I do not have to trust my isp to not be evil. There is nothing my isp can do to read the password. I do have to trust you, you could easily modify the software in a way to read my password.
- voidUpdate 3mo agoWhat are the $25k in tokens for? Does firefox's build system not allow building to wasm?
- degamad 3mo ago> ... tokens for debugging and JIT research
- voidUpdate 3mo agoit cost 25 thousand dollars to bugtest? jesus christ
- poulpy123 3mo agoYo, I've heard you like browser so we've put a browser into your browser
- elombn 3mo ago[dead]
- virajk_31 3mo agoI checked internet speed inside and outside the wasm, and inside wasm its 10x slower, what could be the reason?
- rlmineing_dead 3mo agoThere's several opportunities for a bottleneck but it could be either the TCP implementation just not being good at receiving packets or the TCP proxy side just being congested from HN traffic
- devttyeu 3mo agoOh wow didn't expect this to be either possible or this perform so well. Also fascinating how small the wasm binary is. I made a Wasm port of FreeCad (also had a fairly popular thread here a few days ago) but that image was close to 300MB uncompressed / 90MB compressed with Brotli. (btw none of my wasm CAD ports seem to run, each with slightly different flavors of missing wasm features it seems - I have them linked on https://magik.net https://magik.net if you want to debug for whatever reason)
- rlmineing_dead 3mo agoPerforms so well is... Subjective but generally what matters here surprisingly is not CPU speed but GPU driver quality (all on Chromium) I tested a bunch of stuff before this post went live Apple M1/M2/M3/M4 on macOS Sequoia, good Apple M5 and prior chips on tahoe, bad due to a known GPU regression (this is actually why my personal machine runs sequoia) Windows on ARM Qualcomm Adreno X1 driver - bad to usable performance Ubuntu 26.04 Aarch64 upstream mesa with freedreno - works really well but encounters artifacting Pixel 10 Pro - doesn't work here at all Intel HD4600 on Windows 11 i7-4790k- works quite well up to 2 tabs where the renderer starts really suffering
- smalltorch 3mo agoI think it should check if my browser is compatible before downloading 50+ mb.
- thx67 3mo agoFirefox ESR in Debian12, won't start. 140.12.0esr (64-bit) This is the entirety of the log message. [chrome-demo] chrome assets + engine wasm ready [gecko] warning: unsupported syscall: __syscall_madvise [gecko] embed-xul: main() on the app pthread (PROXY_TO_PTHREAD) [gecko] embed-xul: GECKO_GL_PASSTHROUGH=0 [gecko] embed-xul: GECKO_COARSE_CLOCK=1 [gecko] [libxul] abort: Assertion failed [gecko] Aborted(Assertion failed)
- pjsg 3mo agoThis is amazing -- but there is something wrong with (maybe) the WebGL or color rendering. If you go to https://pskreporter.info/pskmap https://pskreporter.info/pskmap then the ocean should be blue (and it is blue in a native firefox). However it is a shocking shade of pink in the wasmified version. Still, it is amazing that it works at all!
- sunhp 3mo agothis is really impressive ! One question, would it be possible to handle apple retina display ?