.net 是否有用于 Windows/C# 开发的可嵌入 Webkit 组件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/142184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 10:07:20  来源:igfitidea点击:

Is there an embeddable Webkit component for Windows / C# development?

.netcomwebkitgecko

提问by Jon Galloway

I've seen a few COM controls which wrap the Gecko rendering engine (GeckoFX, as well as the control shipped by Mozilla - mozctlx.dll). Is there a wrapper for Webkit that can be included in a .NET Winform application?

我见过一些包装 Gecko 渲染引擎的 COM 控件(GeckoFX,以及 Mozilla 提供的控件 - mozctlx.dll)。是否有可以包含在 .NET Winform 应用程序中的 Webkit 包装器?

采纳答案by Alex Lyman

There's a WebKit-Sharp component on Mono's GitHub Repository. I can't find any web-viewable documentation on it, and I'm not even sure if it's WinForms or GTK# (can't grab the source from here to check at the moment), but it's probably your best bet, either way.

Mono 的 GitHub Repository上有一个 WebKit-Sharp 组件。我找不到任何关于它的 Web 可查看文档,我什至不确定它是 WinForms 还是 GTK#(目前无法从此处获取源代码进行检查),但这可能是您最好的选择道路。

回答by chillitom

I've just release a pre-alpha version of CefSharpmy .Netbindings for the Chromium Embedded Framework.

我刚刚为Chromium Embedded Framework发布了我的.Net绑定的CefSharp的 pre-alpha 版本。

Check it out and give me your thoughts: https://github.com/chillitom/CefSharp(binary libs and example available in the downloads page)

检查一下并给我你的想法:https: //github.com/chillitom/CefSharp(二进制库和示例可在下载页面中找到)

update: Released a new version, includes the ability to bind C# objects into the DOM and more.

更新:发布了一个新版本,包括将 C# 对象绑定到 DOM 等的功能。

update 2: no-longer alpha, lib is used in real world projects including Facebook Messenger for Windows, Rdio's Windows client and Github for Windows

更新 2:不再是 alpha,lib 用于现实世界的项目,包括 Facebook Messenger for Windows、Rdio 的 Windows 客户端和 Github for Windows

回答by Petr Havlicek

Haven't tried yet but found WebKit.NETon SourceForge. It was moved to GitHub.

尚未尝试,但在 SourceForge 上找到了WebKit.NET。它已移至GitHub

Warning:Not maintained anymore, last commits are from early 2013

警告:不再维护,最后一次提交来自 2013 年初

回答by Kevin Driedger

Berkeliumis a C++ tool for making chrome embeddable.

Berkelium是一个 C++ 工具,用于使 chrome 可嵌入。

AwesomiumDotNetis a wrapper around both Berkeliumand Awesomium

AwesomiumDotNet是双方围绕一个包装Awesomium

BTW, the link here to Awesomiumappears to be more current.

顺便说一句,这里到Awesomium的链接似乎是最新的。

回答by Regfor

There's a WebKit-Sharp component on Mono's Subversion Server. I can't find any web-viewable documentation on it, and I'm not even sure if it's WinForms or GTK# (can't grab the source from here to check at the moment), but it's probably your best bet, either way.

Mono 的 Subversion 服务器上有一个 WebKit-Sharp 组件。我找不到任何关于它的 Web 可查看文档,我什至不确定它是 WinForms 还是 GTK#(目前无法从此处获取源代码进行检查),但这可能是您最好的选择道路。

I think this component is CLI wrapper around webkit for Ubuntu. So this wrapper most likely could be not working on win32

我认为这个组件是围绕 Ubuntu 的 webkit 的 CLI 包装器。所以这个包装器很可能不能在 win32 上工作

Try check another variant - project awesomium- wrapper around google project "Chromium" that use webkit. Also awesomium has features like to should interavtive web pages on 3D objects under WPF

尝试检查另一个变体 - 项目awesomium-使用 webkit 的谷歌项目“ Chromium”的包装器。awesomium 还具有在 WPF 下在 3D 对象上交互网页的功能

回答by George

There is OpenWebKitSharp, a fork of WebKit.NET 0.5 and very advanced. Details: http://code.google.com/p/open-webkit-sharp/

OpenWebKitSharp 是 WebKit.NET 0.5 的一个分支,非常先进。详情:http: //code.google.com/p/open-webkit-sharp/

回答by Dinis Cruz

回答by Vladimir

Take a look at the DotNetBrowserlibrary. It provides Chromium-based WPF and WinForms browser controls, which are quite easy to embed into .NET application. It supports all the modern web standards including HTML5, CSS3 and JavaScript. The rendered page looks exactly like in Google Chrome.

查看DotNetBrowser库。它提供了基于 Chromium 的 WPF 和 WinForms 浏览器控件,这些控件非常容易嵌入到 .NET 应用程序中。它支持所有现代 Web 标准,包括 HTML5、CSS3 和 JavaScript。呈现的页面看起来与 Google Chrome 中的完全一样。

The library inherits Chromium's multi-process architecture – each web page is rendered in a separate Chromium process, and the application will continue working even after plugin crash or any other unexpected error occurs on the web page.

该库继承了 Chromium 的多进程架构——每个网页都在单独的 Chromium 进程中呈现,即使在插件崩溃或网页上发生任何其他意外错误后,应用程序仍将继续工作。

Here are some other useful features, provided by DotNetBrowser: it is possible to listen to load events, handle network activity, configure proxy, simulate user actions, work with cookies, access and modify DOM, listen to DOM events, call JavaScript from .NET and vice versa, use web camera and microphone on the web page, set up WebRTC-based communication, and more.

以下是 DotNetBrowser 提供的一些其他有用功能:可以侦听加载事件、处理网络活动、配置代理、模拟用户操作、使用 cookie、访问和修改 DOM、侦听 DOM 事件、从 .NET 调用 JavaScript反之亦然,在网页上使用网络摄像头和麦克风,设置基于 WebRTC 的通信等等

Check out the API Referencefor more details.

查看API 参考以获取更多详细信息。

The code snippet below demonstrates how to create a BrowserView, embed it into a Form, and load a URL:

下面的代码片段演示了如何创建一个 BrowserView,将它嵌入到一个表单中,并加载一个 URL:

using System.Windows.Forms;
using DotNetBrowser;
using DotNetBrowser.WinForms;

namespace WinForms.DotNetBrowser
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            BrowserView browserView = new WinFormsBrowserView();
            Controls.Add((Control) browserView);
            browserView.Browser.LoadURL("http://www.youtube.com");
        }
    }
}

Once you run the example above you will get the following output:

运行上面的示例后,您将获得以下输出:

enter image description here

在此处输入图片说明

The library is commercial. Commercial licenses include support packages for different team sizes. It is also possible to purchase the library's source code.

图书馆是商业性的。商业许可证包括针对不同团队规模的支持包。也可以购买库的源代码。

Besides its own page the component is available as NuGet packageand as VSIX packagein the Visual Studio Marketplace.

除了它自己的页面之外,该组件还可以作为NuGet 包和Visual Studio Marketplace 中的VSIX 包使用。

回答by Andy Brice

The Windows version of Qt 4 includes both WebKit and classes to create ActiveX components. It probably isn't an ideal solution if you aren't already using Qt though.

Qt 4 的 Windows 版本包括 WebKit 和用于创建 ActiveX 组件的类。如果您还没有使用 Qt,它可能不是一个理想的解决方案。

回答by swilliams

I don't think there is a current one out there, but there is a [barely documented] project on Google Codewith an older version...

我不认为目前有一个,但在谷歌代码上有一个[几乎没有记录的]项目,有一个旧版本......