Recently, I’ve been experimenting with a reimplementation of Graphene on Gecko that doesn’t require B2G. Graphene is a desktop runtime for HTML apps, and Browser.html uses it to run on Servo. There’s a Gecko implementation of Graphene that is based on B2G, but it isn’t maintained and appears to have bitrotted. It also entrains all of B2G, although Browser.html doesn’t use many B2G features.
My reimplementation is minimal. All it does is load a URL in a native window and expose a few basic APIs (including
<iframe mozbrowser>). But that’s enough to run Browser.html. And since Browser.html is a web app, it can be loaded from a web server (with this change that exposes
<iframe mozbrowser> to https: URLs).
I forked browserhtml/browserhtml to mykmelez/browserhtml, built it locally, and then pushed the build to my GitHub Pages website at mykmelez.github.io/browserhtml. Then I forked mozilla/gecko-dev to mykmelez/graphene-gecko and reimplemented Graphene in it. I put the implementation into embedding/graphene/, but I could have put it anywhere, including in a separate repo, per A Mozilla App Outside Central.
To try it out, clone, build, and run it:
git clone https://github.com/mykmelez/graphene-gecko cd graphene-gecko ./mach build && ./mach run https://mykmelez.github.io/browserhtml/
You’ll get a native window with Browser.html running in Graphene: