Replacing .NET WebBrowser control with a better browser, like Chrome? [closed] Ask Question

Replacing .NET WebBrowser control with a better browser, like Chrome? [closed] Ask Question

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

ベストアンサー1

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.

WPFおよびWinforms用のブラウザー コントロールを備え、多数の機能と拡張ポイントを備えています。Chromium をベースとしているため、非常に高速です。

NuGetから入手:dotnet add package CefSharp.Wpfまたはdotnet add package CefSharp.WinForms

例を確認し、ご意見/フィードバック/プルリクエストをお寄せください:https://github.com/cefsharp/CefSharp

BSDライセンス

おすすめ記事