views:

3171

answers:

5

Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE<n>.

I'm wondering how does one integrate a Gecko or WebKit one.

  1. Are there VCL examples somewhere?
  2. If not, how would one go about doing it?
  3. Where's the best place to find the core for Gecko and/or WebKit in an embeddable format?
+9  A: 

TWebBrowser is IE. It is not a plugable construction for browsers. You can have other browsers integrated in your application. See

Lars Truijens
I was not implying that TWebBrowser was a pluggable interface. I'm fully aware that it IS IE :)
Gustavo Carreno
I'm loving your links, however, since my early Googling on the matter returned nothing of interest :)
Gustavo Carreno
Check out the "Bagel" project. See more in my answer.
TomC
You link to newbielabs.com is wrong, it should be: http://ftp.newbielabs.com/Delphi%20Gecko%20SDK/
stukelly
@stukelly: Thanks. I fixed the link
Lars Truijens
+2  A: 

Edit: Lars beat me to it, unfortunately

Well there is an ActiveX control based on the Gecko engine that tries to present an exact copy of the IWebBrowser API (which TWebBrowser uses).

You can find it here: http://www.iol.ie/~locka/mozilla/control.htm Unfortunately it looks like it hasn't been updated in a while. The last version is based on Gecko 1.7.12 and I believe Gecko is currently up to 1.9.x (used in Firefox 3)

Otherside
+2  A: 

An alternative is THTMLViewer component. I have used this for some years.

This is now available free. the web siteis here http://pbear.com/htmlviewers.html. According to the songbeamer web site (http://www.songbeamer.com/delphi/) there is a Delphi 2009 version available.

dcraggs
As the original author of PBear is not able to support the code anymore, we've moved the development on this to : http://sourceforge.net/projects/htmlviewer
PatrickvL
@PatrickvL: Is the HtmlViewer software still being further developed ?
Edelcom
@Edelcom : If you look at the htmlviewer project website, you'll see it was moved over to google code in the mean time. If you look here http://code.google.com/p/thtmlviewer/updates/list you'll see that the most recent activity was only a few days ago, so I think the answer is 'Yes!'. ;-)
PatrickvL
+1  A: 

Over the last three years I have come across very little in the way of embedding Gecko in Delphi. One library that showed up fairly late in the game (for me) was the GeckoSDK project on SourceForge. I did a lot of work early on trying to make embedded Gecko work correctly in Delphi. Our first attempt at a Gecko rendering engine based internal "browser" was built using Delphi and Gecko 1.8. We have since moved on and our browser is now a XULRunner application. I have pieces of code laying around on my hard drive yet from that early attempt that I have not deleted yet.

When Mozilla releases Gecko 2.0 I think it will become a lot easier to embed in Delphi. The XPCOM object system in Gecko makes it very difficult to embed because most everything returns an NS_RESULT. Strings especially were hard.

edit: I just looked through my old bookmarks (almost all of which are dead) and searched for a new url for the Japanese language "bagel" browser based on Gecko and found it here,

http://github.com/plus7/bagel/tree/master/Legacy.

This is probably your best bet for some excellent code to start from. Unfortunately the comments in the code are Japanese and the author never responded to questions.

TomC
Thanks for the tip. Looks quite helpfull!!
Gustavo Carreno
It sounds exciting with Gecko 2.0! Do you have a webpage with more information? Maybe a roadmap and a schedule for releases etc.
Roland Bengtsson
Still no sign of Gecko 2.0 as far as I can tell.
TomC
+3  A: 

A viable alternative is CEF - Chromium Embedded Framework which encapsulates the Chromium browser which by itself encapsulates WebKit. This library is provided as plain DLLs with an exported C API.

There's a delphi interface available at code.google.com/p/delphichromiumembedded

I've been using it with my own interface implementation and works great, though not so easy to properly use as THTML or IE, but great for whoever needs a powerful and embeddable browser.

carlosb
Thanks for the tips Carlos. Just a little favour: Could you add a link to those URLs you mention? I don't have the power to edit your answer :) Thanks.
Gustavo Carreno
Links added as requested :)
carlosb