Replacing .NET WebBrowser control with a better browser, like Chrome?

Sylverdrag picture Sylverdrag · Apr 26, 2009 · Viewed 458.5k times · Source

Is there any relatively easy way to insert a modern browser into a .NET application?

As far as I understand, the WebBrowser control is a wrapper for IE, which wouldn't be a problem except that it looks like it is a very old version of IE, with all that entails in terms of CSS screw-ups, potential security risks (if the rendering engine wasn't patched, can I really expect the zillion buffer overflow problems to be fixed?), and other issues.

I am using Visual Studio C# (express edition - does it make any difference here?)

I would like to integrate a good web browser in my applications. In some, I just use it to handle the user registration process, interface with some of my website's features and other things of that order, but I have another application in mind that will require more err... control.

I need:

  • A browser that can integrate inside a window of my application (not a separate window)
  • A good support for CSS, js and other web technologies, on par with any modern browser
  • Basic browser functions like "navigate", "back", "reload"...
  • Liberal access to the page code and output.

I was thinking about Chrome, since it comes under the BSD license, but I would be just as happy with a recent version of IE.

As much as possible, I would like to keep things simple. The best would be if one could patch the existing WebBrowser control, which does already about 70% of what I need, but I don't think that's possible.

I have found an activeX control for Mozilla (http://www.iol.ie/~locka/mozilla/control.htm) but it looks like it's an old version, so it's not necessarily an improvement.

I am open to suggestions

Answer

chillitom picture chillitom · Dec 3, 2010

Checkout CefSharp .Net bindings, a project I started a while back that thankfully got picked up by the community and turned into something wonderful.

The project wraps the Chromium Embedded Framework and has been used in a number of major projects including Rdio's Windows client, Facebook Messenger for Windows and Github for Windows.

It features browser controls for WPF and Winforms and has tons of features and extension points. Being based on Chromium it's blisteringly fast too.

Grab it from NuGet: Install-Package CefSharp.Wpf or Install-Package CefSharp.WinForms

Check out examples and give your thoughts/feedback/pull-requests: https://github.com/cefsharp/CefSharp

BSD Licensed