Is it possible to Embed Gecko or Webkit in a Windows Form just like a WebView?
Asked Answered
P

10

71

I'd love to know if there is such a 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.

UPDATE October 2013: I am no longer doing Windows development so I have no interest in this, but seems like the development of Gecko can be found here: https://bitbucket.org/geckofx and it seems to be recently updated. Leaving this here for future Windows devs ;)

UPDATE January 2017: I have gotten an email from a company called TeamDev. They created a Chromium-based .NET browser component called "DotNetBrowser" which can be used to display modern web pages in Windows Forms applications.

To quote the email directly:

Here are some details about the component, which might be helpful:

  1. DotNetBrowser is based on Chromium, thus supporting HTML5, CSS3, JS and the latest web standards. The underlying Chromium version of the library is regularly updated.
  2. The component is suitable for WPF as well as Windows Forms desktop applications, and works both for C# and VB.NET.
  3. The library is licensed commercially, however free licences are provided for Open Source and academic projects.

Disclaimer: I have not used this DotNetBrowser for I no longer do Windows Development but may be worth checking if you're looking for a solution to this.

Protuberancy answered 25/8, 2008 at 14:45 Comment(0)
F
49

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

This is a nice .NET-wrapped version of Gecko

Fons answered 28/8, 2008 at 9:40 Comment(0)
C
10

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.

Cookstove answered 25/8, 2008 at 14:49 Comment(1)
The answer below should be the answer. GeckoFX is an updated .NET wrapper, the ActiveX control has not been updated since 2005.Activate
C
9

GeckoFX is no longer being updated. The alternative is the MozNet XulRunner wrapper by Se7en Soft. MozNet has a ton of features that GeckoFX doesn't and is being actively updated and maintained.

Ceyx answered 17/2, 2011 at 21:12 Comment(4)
MozNet's EULA contradicts LGPL, making it illegal. Don't use it.Qualitative
worse than that, there is now no longer a free demo. It's unlikely one is going to purchase an alternative to an IE plugin component they can verify that it's capable of performing whatever task you weren't able to accomplish with the IE componentFirebug
Active developed project of GeckoFX is available at: bitbucket.org/geckofxMignon
MozNet is not longer supported by the author.Wideawake
C
8

I'd just like to point out, to all looking to embed Gecko into their applications, that the GeckoFX project appears to have been abandoned by its creators (Skybound Software). MozNET, while previously based on GeckoFX, sorta' picked up the ball and ran with it. It has the full ability to print, do print previews and allows you to set it all up via the native Windows print dialog, even - and a whole lot more.

Ceyx answered 22/2, 2011 at 12:59 Comment(2)
GeckoFX is being actively developed at: bitbucketBicycle
MozNet is not longer supported by the author.Wideawake
B
4

OpenWebKitSharp is a wrapper arount the WebKit engine (nightly) and is very advanced. Take a look at here (OpenWebKitSharp section): http://code.google.com/p/open-webkit-sharp/

Brunson answered 6/10, 2011 at 17:50 Comment(2)
By far the best WebBrowser Control for non-IE needs for .NetChou
OpenWebkitSharp was disabandoned and is therefore useless. Existing errors are not fixed anymore and one can not live with them.Chitter
F
4

Update 2016:

BrowseEmAll.Gecko

A .Net component which can be used to integrate the Firefox engine into your .Net application. This is based on Geckofx but unlike the current version of Geckofx this will work with a normal release build of Firefox. To use Geckofx you will need to build Firefox yourself. Again commercial support is available but the component itself is fully open source.

(Full disclosure: I work for this company so take everything I say with a grain of salt)

Foran answered 13/2, 2016 at 10:43 Comment(1)
Possibly a stupid question, but does a particular version of Firefox have to be installed on the end-user's machine?Heliopolis
C
3

@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.

Cookstove answered 25/8, 2008 at 16:52 Comment(1)
I want to transfer winform data to Firefox browser. It can be possible through OpenWebKitSharp class Library also can it works for FF 26.0 versionIncurve
V
3

As of October 30, 2011, there is new information to add since the time of the previous posts. Specifically, while Skybound stopped maintaining their version, there is at least one actively maintained, free, open-source fork available.

I'm using Hindle's fork at BitBucket, which, by virtue of his tool which parses XpCom idls and creates c# wrappers, is rapidly updated with support for each new version of Firefox/Gecko.

See this post for an overview of other choices.

Vargas answered 30/10, 2011 at 20:2 Comment(0)
C
2

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.

Copulation answered 25/8, 2008 at 16:40 Comment(0)
Z
2

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.

Zabrine answered 19/5, 2009 at 11:41 Comment(1)
Active developed vesrion of GeckoFX is available at: bitbucket.org/geckofxMignon

© 2022 - 2024 — McMap. All rights reserved.