views:

14261

answers:

9

Hi, I'd love to know if there is such thing as a Gecko.NET ;) I mean, just like we can embed a WebView and that is an "instance" of IE7 inside any Windows Forms application (and tell it to "navigateto (fancy_url);", I'd love to use FireFox or WebKit.

Anybody tried this?

UPDATE: Please bear in mind that although it is possible to embed gecko using the mentioned controls, it is still impossible to print while using gecko.

UPDATE March 2010: It’s still not possible to print natively using GeckoFX, however a couple of methods exist that may be enough, depending upon what you’re trying to do. See: http://geckofx.org/viewtopic.php?id=796 for more information.

+9  A: 

It certainly is possible. All you need to do is register the Mozilla ActiveX control (mozctlx.dll I believe), and you can drag it onto your form as any ActiveX control. The programming interface is similar (though not identical) to the IE one, and you can even use the Microsoft.MSHTML.dll managed library for control in some cases.

I believe this is packaged with Firefox. If not, you can get just the embeddable bits from Mozilla as well. Just do a Google search for Mozilla ActiveX control or Mozilla Embedding C# and that should take you down the right path.

DannySmurf
The answer below should be the answer. GeckoFX is an updated .NET wrapper, the ActiveX control has not been updated since 2005.
Sire
+1  A: 

Thanks!

The only drawback is that the ActiveX control is rather outdated :S This is the page: Mozilla ActiveX Control.

Yet the latest "news" is:

15/12/2005: I have released a test version of the ActiveX plugin for Firefox 1.5 now available. If all goes well with no reported issues, this will become the release version.

No fancy ffox 3.0 yet (not even 2.0) so I guess the project is "kind of dead"?

Martín Marconcini
+1  A: 

Additionally, if you find yourself using Gtk instead of Windows.Forms, there is a tarball of webkit-sharp available that allows for easy embedding of WebViews into Gtk# applications.

wfarr
+3  A: 

@Martin: Yes, the Adam Locke version is outdated. But that's because a separate distribution is not necessary. It's built with the rest of the Mozilla codebase now.

If you download Prism (ie XulRunner), that will give you a base that you can customize to your needs, and this includes the most recent version of the control (in the \Prism\xulrunner directory, you'll find mozctlx.dll).

@Greg: Actually, it is an ActiveX control. Incidentally, all ActiveX controls are COM controls. ActiveX is built on COM.

DannySmurf
+17  A: 

http://code.google.com/p/geckofx/

This is a nice .NET-wrapped version of Gecko

HS
A: 

I Belive "Gecko FX"[1] is the thing you need.

To Quote from the web site

""" GeckoFX is a Windows Forms control written in clean, commented C# that embeds the Mozilla Gecko browser control in any Windows Forms Application. It also contains a simple class model providing access to the HTML and CSS DOM. """

1) I can't post a link as "new users aren't allowed to add hyperlinks" Search for "geckofx" on google code.

garthy
A: 

Just download last Seamonkey. It just contain mozctlx.dll for latest Gecko version ;-)

Kambo
A: 

All the controls you've discussed above - Do they need Firfox installed? or the ActiveX registered? Is there a control which does not require Firefox to be installed or the dll to be registered?

Evans