How can I embed firefox in a GUI application?
Asked Answered
E

5

21

Has anyone ever embedded the firefox web browser technology in their own [unmanaged] C/C++ GUI application in the same way that IE can be embedded as a COM object? (I would like to do this on Linux, not Windows). Are there "better" alternatives to firefox? I'm open to anything as long as I can use it with non-GPL code. My needs are fairly basic; I only need fundamental HTML parsing and display of static local files, but I'd take advantage of more sophisticated technology, if I can get it. I'd like to be able to use JavaScript, but I can get by without it.

Erzurum answered 10/4, 2010 at 1:43 Comment(0)
H
12

First you need to differentiate between HTML engine and JavaScript Engine.

Hedgcock answered 10/4, 2010 at 2:12 Comment(2)
As of 21st December 2022 the links seem to be broken. May they be updated?Ochre
I'm sorry @aturegano, I haven't worked on either of them since a very long time. I know spider monkey moved to its own website here though: spidermonkey.devHedgcock
H
5

Check out webkitgtk. It's not Gecko, but Webkit based. It basically provides a web browser widget that can be used in GTK+ applications. If you want to embed mozilla, there are things in the mercurial repositories for Mozilla repository that let you do it, but it didn't seem heavily supported last I checked.

Hydrophobic answered 10/4, 2010 at 1:52 Comment(1)
This is probably worth a separate answer, but you could also look into XUL Runner, which is what Firefox is essentially built on top of. You can write your UI in XML, JS, and CSS. There is also a C++ interface for the components.Hydrophobic
I
4

as stated by Mozilla

Embedding of Gecko is no longer supported

so have a look on either previous mentioned Chromium Embedded Framework or WebKit. Alternatively, you can follow Mozilla's new project https://servo.org/.

You will find some more up to date information on Is it possible to Embed Gecko or Webkit in a Windows Form just like a WebView?

Inference answered 21/12, 2018 at 16:51 Comment(0)
R
3

It is possible to use parts of Firefox (such as the Gecko renderer) in other apps. There are various approaches to this, including wxWebConnect, a web browser control for wxWidgets. See also Embedding Gecko

Another popular solution is WebKit. Again, there are various ways you can use this, including QtWebKit (a wrapper for the Qt toolkit) and webkitgtk (already mentioned by SB).

Rafaelle answered 10/4, 2010 at 2:7 Comment(0)
H
2

Have a look at CEF (Chromium Embedded Framework). It is very similar to WebKit and it also has built-in HTML and JavaScript engines embedded but has better WebGL and HTML5 Canvas support. It is released under BSD license.

Hbeam answered 27/1, 2015 at 19:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.