I've been testing alternatives to C# Web browser component for few days now and here is my list:
1. Using newer IE versions 8,9:
Web Browser component is IE7 not IE8? How to change this?
Pros:
- Not much work required to get it running
- some HTML5/CSS3 support if IE9, full if IE10
Cons:
- Target machine must have target IE version installed, IE10 is still in preview on Win7
This doesn't require much work and you can get some HTML5 and CSS3 support although IE9 lacks some of best CSS3 and HTML5 features. But I'm sure you could get IE10 running same way. The problem would be that target system would have to have IE10 installed, and since is still in preview on Windows 7 I would suggest against it.
2. OpenWebKitSharp
OpenWebKitSharp is a .net wrapper for the webkit engine based on the WebKit.NET 0.5 project. WebKit is a layout engine used by Chrome/Safari
Pros:
- Actively developed
- HTML5/CSS3 support
Cons:
- Many features not implemented
- Doesn't support x64 (App must be built for x86)
OpenWebKit is quite nice although many features are not yet implemented, I experienced few issues using it with visual studio which throws null object reference here and then in design mode, there are some js problems. Everyone using it will almost immediately notice js alert does nothing. Events like mouseup,mousedown... etc. doesn't work, js drag and drop is buggy and so on..
I also had some difficulties installing it since it requires specific version of VC redistributable installed, so after exception I looked at event log, found version of VC and installed it.
3. GeckoFX
Pros:
- Works on mono
- Actively developed
- HTML5/CSS3 support
Cons:
- D̶o̶e̶s̶n̶'̶t̶ ̶s̶u̶p̶p̶o̶r̶t̶ ̶x̶6̶4̶ ̶(̶A̶p̶p̶ ̶m̶u̶s̶t̶ ̶b̶e̶ ̶b̶u̶i̶l̶t̶ ̶f̶o̶r̶ ̶x̶8̶6̶)̶ - see comments below
GeckoFX is a cross platform Webrowser control for embedding into WinForms Applications. This can be used with .NET on Windows and with mono on Linux.
Gecko is a layout engine used by Firefox.
I bumped into few information that GeckoFX is not actively developed which is not true, of course it's always one or two versions behind of Firefox but that is normal, I was really impressed by activity and the control itself. It does everything I needed, but I needed some time to get it running, here's a little tutorial to get it running:
- Download GeckoFx-Windows-16.0-0.2, here you can check if newer is available GeckoFX
- Add references to two downloaded dll's
- Since GeckoFX is wrapper you need XulRunner, go to Version List to see which one you need
- Now that we know which version of XulRunner we need, we go to
Mozilla XulRunner releases, go to version folder -> runtimes -> xulrunner-(your_version).en-US.win32.zip, in our case xulrunner-16.0.en-US.win32.zip
- Unzip everything and copy all files to your bin\Debug (or release if
your project is set to release)
- Go to visual studio designer of your form, go to toolbox, right click inside -> Choose items -> Browse -> Find downloaded GeckoFX winforms dll file -> OK
- Now you should have new control GeckoWebBrowser
If your really must use Chrome, take a look at this product called Awesomium, it's free for non-commercial projects, but license is few thousand dollars for commercial.