4

I was really excited when I found GeckoFX last month. My employer wants to distribute an embedded browser with our desktop application (to smooth the transition from desktop-based apps to web-based apps), and being able to use Gecko rather than IE was a miracle!

The latest versions of GeckoFX I can find use versions 1.9.1 and 1.9.2 of the Gecko engine (Xulrunner). This works just fine, but it's missing a lot of the goodies that shipped with Firefox 4 (Gecko 2.0) this week.

I already have the distribution of Xulrunner 2.0, but GeckoFX won't work with it out of the box. Some of the XPCOM API has changed, and I'm sure there are a lot of other minor incompatibilities. I'd say it should be an easy fix, but I'm not a C++ developer so I really have no idea.

What I'm looking for right now is one of the following, in order of preference:

  1. An already-built update of GeckoFX that's compatible with Xulrunner 2.0
  2. Another solution that allows me to embed a Gecko-powered web browser in a C# Windows application.
  3. Advice on where to start to update GeckoFX myself (by advice I mean hold-my-hand-and-talk-to-me-like-I'm-6 advice)

Just digging in to the code and trying to sort through all the errors doesn't help. I keep getting an InvalidCastException when trying to create an instance of nsIWebBrowser (and no, I can't get more descriptive than that because that's all the error message and stack trace show!). It's been a lot of head scratching and pointless Googling since it seems no one's kicked off an embedded Firefox 4 yet.

Ideas? Suggestions?

EAMann
  • 4,128
  • 2
  • 29
  • 48
  • I am unable to browse the below website using your Gecko Wrapper for .net . http://premier.ticketek.com.au/shows/show.aspx?sh=KYLIEMIN11 Please help me it urgent for me. If possible please provide me the sample application that can run that above link. Thanks. –  Apr 09 '11 at 16:21
  • Adeel - if you're having a support issue or running in to a specific bug, please report it as an Issue on the Google Code site => http://code.google.com/p/leapin-lizard/issues/list. That said, please be more clear in your request. The link runs just fine using the Gecko Wrapper, and I'm concerned you might be asking for someone to do the work of building an application for you. – EAMann Apr 12 '11 at 15:47

2 Answers2

2

In the absence of deeper help, I took the time to dig in and figure things out on my own. The trick was understanding ComImport, which is something I haven't used before.

It turns out, Mozilla changed the GUIDs of some of the API methods exposed by XPCOM. Most importantly, the GUID for nsIWebBrowser changed from 69E5DF00-7B8B-11d3-AF61-00A024FFC08C to 33e9d001-caab-4ba9-8961-54902f197202.

Making this one change in nsInterfaces.cs actually fixed quite a bit.

Going through line-by-line and reconciling build errors (despite cryptic error messages) allowed me to finish out the system and create a build that does indeed run XULRunner 2.0.

Unfortunately, being able to build and run Gecko 2 and exposing the entire API are two very different things. I've created a project on Google Code to house a complete rewrite of GeckoFX for Gecko 2: Leapin' Lizard. It's essentially a fork of the original Skybound.Gecko code, and distributed under the same open source licenses.

So I now have a build of GeckoFX that's compatible with XULRunner 2.0. It just needs to be polished.

EAMann
  • 4,128
  • 2
  • 29
  • 48
  • Facing the same issue, where to download Leapin' Lizard? as Google Code page doesn't show any downloads... – Kushal Apr 01 '11 at 05:54
  • Check out the code using Mercurial. You want to use the Gecko 2.0 branch. Once I'm done cleaning up the code (whole chunks of the XPCOM API are missing), I'll publish a build as a downloadable ZIP file. For now, unfortunately, you'll have to check out the code and build it yourself. – EAMann Apr 01 '11 at 14:08
  • Thanks, looking forward for "bright future" of apps running Gecko on top .NET. ;-) – Kushal Apr 01 '11 at 15:43
  • I'm looking at adding xulrunner 2.0 support to my cross platform geckofx fork, https://bitbucket.org/geckofx/geckofx/ Your changes looks like a good start. Any idea how complete are they? – Tom Apr 12 '11 at 22:49
  • I'm maybe 25% of the way through the API. I'm also adding a lot of documentation as I go to make the library easier to develop with. Unfortunately it's huge as-is, and doesn't have full DOM support for HTML5 yet. That's on the to-do list, it'll just take time. – EAMann Apr 13 '11 at 04:00
0

At the moment there is no pre-compiled library that wraps XulRunner 4.0. I am the author of MozNET, a Mozilla wrapper build that is actually being actively developed. I do have a semi-working build, utilizing XulRunner 2.0 but, it is not yet complete. Due to the changes made in XulRunner 2.0 there are still a ton of changes to in order to make MozNET fully compatible with the new build. At the moment I have full browsing support, nearly-complete DOM object access and full spell check support. The build is a work in progress as I am still maintaining and supporting MozNET 1.9.2.17.

Scott
  • 23
  • 2
user257033
  • 53
  • 4
  • Just to let you know, your website (that supports MozNET) keeps timing out when I try to go to it. And I was considering your library, but without XulRunner 2.0 support it doesn't really suit my needs ... which is why I rolled my own instead. Sorry :-( – EAMann Apr 13 '11 at 04:00