Replacing Latest .NET WebBrowser Control with a br

2019-06-12 20:05发布

问题:

I am using Visual Studio C# found an ActiveX control but it looks like it's an old version.

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.

回答1:

Take a look at CefSharp: https://github.com/cefsharp/CefSharp

CefSharp lets you embed Chromium in .NET apps. It is a lightweight .NET wrapper around the Chromium Embedded Framework (CEF) by Marshall A. Greenblatt. About 30% of the bindings are written in C++/CLI with the majority of code here is C#. It can be used from C# or VB, or any other CLR language. CefSharp provides both WPF and WinForms web browser control implementations.



回答2:

take a look at GeckoFx https://bitbucket.org/geckofx/. I was using it about 2 year ago and it was pretty easy to use. It's free and not "dead", meaning it is being keeped up to date.



回答3:

DotNetBrowser can satisfy your needs.

This library provides Chromium-based WPF and WinForms components that can be embedded into your .NET application. The component supports HTML5, CSS, JavaScript, DOM access, DOM events and even calling JavaScript from C# and vice versa.

DotNetBrowser API also provides basic browser functions like loading URLs and HTML, reloading page, navigating back and forward, working with cookies, etc. Actually, all its functions are perfectly described in the product's Knowledge Base.

The control is commercial,but there are free academic and open-source licenses.



回答4:

SharpBrowser based on cefsharp . accidentally found it while browsing the cefsharp repos

http://github.com/sharpbrowser/SharpBrowser