G.ene - One-Day-Experiment Gecko alternative to Electron/nw.js

(Daniele Scasciafratte) #1

First of all this is a volunteer experiment done in one day to discover the features of Graphene.
Graphene is a build of B2G used in Browser.html and for Firefox OS testing.
The interesting feature of this project that is like a Firefox without the UI, only the Web rendered engine and that support the Firefox OS APIs.
My idea when I started that project was a “Firefox OS is not dead to give us that chance” to fight the monopoly of WebKit in the web.

So after the discover of that build I tried to experiment to create an alternative to Electron/nw.js that are webkit based.
In the repo you can find all the information to replicate and try yourself and the list of api supported on that build and that works.

After the experiments I see that this build is not enough to create an alternative because the interesting APIs like Service Worker, Video/Audio capture and Notification not works.
That is ok because is an internal build used for specific use and my was only an experiment to search an alternative.
So if you want an HTML5 app that run on a browser without the UI (like a packaged app) Graphene is ok but remember is an internal build.

The rest of infos are in the Readme, if you have other questions I am here.

(Michael Kohler) #2

This is a great experiment, thanks!

Do you know what it would mean in terms of invested time to add those APIs as well? Or would it be enough to have a more recent Gecko build below it?

Having a Gecko-based alternative to Electron and nw.js would be great IMHO, but we would need to make sure that this is as easy as possible so it doesn’t require a full time job to maintain it :slight_smile:

(Daniele Scasciafratte) #3

Well Graphene is a specific build for desktop that use the Gecko nightly so I think that some APIs are disabled in compiling and they are detectable only for testing.

I think that not require so much time because Firefox for desktop have that APIs and the FXOS simulator have that api.
So I think that is only a question of compile with a few patch to enable the support.
But I am not a Firefox/Gecko developer and these are only thought by me.

I think that Graphene is useful because is based on Firefox OS and support the Open Web App that will be removed soon in Firefox but at the same time require the APIs wroking.

Maybe create an another specific build with that APIs enabled is the best solution.

(Kent James) #4

It’s a pity that Mozilla seems to be abandoning all ways that the gecko engine can be used outside of Firefox. I don’t understand Mozilla anymore, I thought that the whole point was to encourage the web platform, but now it seems to be only about Firefox the product.

This is a critical issue to us at Thunderbird, as we use Gecko as a platform but Mozilla wants to discourage that. We are looking for an alternative. Electron is appealing.

(Paul) #5

This is very interesting!

We are seriously thinking of building a clone of Electron, but not with Gecko, but Servo.

Basically, instead of Node, we would use SpiderMonkey, with modules in Rust (exposed to JS). We already have a proof-of-concept of an event loop written in Rust that would load a JS file and execute it with Spidermonkey. The BrowserWindow would use Servo (not implemented yet).

(Paul) #6

Here is a detailed plan for Electron + Servo: https://github.com/servo/servo/issues/7379#issuecomment-135415802

I’ll add that some people are interested of doing the same thing with Gecko: https://groups.google.com/forum/#!msg/mozilla.dev.platform/iLpHjYWmIMg/1yitUUYEAQAJ

But I believe it’s more realistic to build this with the most recent technology we have in hands (rust + spidermonkey + servo).

(Daniele Scasciafratte) #7

My hope was Gecko because is stable and supports all the latest APIs and with the Firefox OS APIs support was easy to have full access to the system.
I read it all the chat on the mailing list and i hope to an alternative to WebKit in that world.
I think that Firefox have a chance to enter in that world and change the situation and attract new contributors.

Also my hope is to have a system node-free and all the part to access to the system is made from the engine. In this way distribute web apps is more easy respect to use npm and download hundred and hundred of megabyte to run a web application.

Before that we had the Open Web App for firefox that use the same Firefox in the environment and we need an alternative.

To evaluate Servo there is a list of difference with Gecko on the APIs supported?

I hope to see soon a prototype that works!

(Sapioit) #8

How much space on disk would the simplest app for Graphene take?
Why is this not continued?

The only way I see this being a competitor of Electron and nw.js is… having a smaller size… OR php instead of Node…

(I created this account only to post this one comment…)

(Daniele Scasciafratte) #9

As explained this as an experiment and in the thread comments you can find the reply to all of your answers.

(Michael Kohler) #10

Positron seems to come along nicely, in case you want yourself to keep updated on that :slightly_smiling:

(Leo McArdle) #11