Embedding Firefox, difficulties and gimmicks

Kevin Ingwersen <[email protected]> Thu, 1 May 2014 04:44:36 +0200
Newsgroups gmane.comp.mozilla.devel.embedding
Message-ID <[email protected]>
Hey everyone.

I signed up for this list, because it was the only one whose description ca=
me close to what I am trying to do at these days.

A while ago, Github=92s Atom.io went into private beta, and I was lucky to =
get an invitation. But I am one that likes to explore, so I took it apart a=
nd spied at its components with arbitary tools like nm, objdump and otool. =
And it turned out, that Github had done something that a few people have be=
en striving to do.

Longer ago, somebody created Appjs, it intended to bring html/js based apps=
 to the desktop. It was based off CEF1 and ran rather okay. Not the best pe=
rformance, but okay. Meanwhile, node-webkit was founded, and the both kept =
going=85however, Apppjs became deprecated, node-webkit keeps going but stay=
s rather non-popular (i have not met a single node-webkit based app, ever).

AppJS was given to me, and a friend and me kept trying ot keep the idea of =
AppJS going. But unfortunately, we ran into a wall: you cant just take a br=
owser and expect it to act like a nice frontend for a simple app - thus, br=
owsers are large.

So, I learned a lot about browsers, javascript engines, embedding in genera=
l and build tools=85and came to a conclusion that doesnt make me very happy=
. I have to write my own embedding, if I want to get to my aproach, to run =
html/js - possibly PHP - based apps on a desktop, as native as possible.

The past months, I have spend trying out various embeddings - CEF, Chromium=
 Content API, dillo=85 But, i have had a variety of issues. And so I decide=
d to take a look at a browser I use at school a lot - and it turns out it c=
an be embedded.

So I have the following questions:

- How many, approximately, lines are needed to get a basic browser window s=
et up?
- What build system(s) can the embedded parts, and its possible ocmponents,=
 be built with?
- What architecture is used - multi process, or multi thread? Especially im=
portant on OS X, as it is my main development target.
- Can the browser view be used with FLTK, which allows to obtain native win=
dow handles? I guess on OS X, I could set the contentView of an NSWindow - =
is this guess right?
- How easy is the JS api to inject code into a frame and-
- -is there a way to do inter-frame communication?
- Do custom schemes exist? How are they handled?
- Is request interception possible, to inject a PHP instance for example, t=
o evaluate a local PHP file and render the output?
- How large is a basic project with embedded firefox?

And these are just basic questions.

I know, most of you might say =84goto MDN=93, but I just want a simple answ=
er. I have studdied docs for the past ddozen months and have begun work on =
a meta-project, the Phoenix Engine: http://github.com/Deskshell-Core/Phoeni=
xEngine
So all I want, is a simple answer. If I find it considerable, of course I w=
ill go and read the docs.

But I have to decide, which browser to embed, which JS engine to support. I=
f I have to re-write nodejs=92 core partialy to port its API, etc etc etc=
=85

Hopefully I am right here, and you can answer my questions :)


Kind regards,
Kevin Ingwersen!