CEFCharp提供了下载接口,但是可能有些版本并未实现,导致不能进行下载,所以需要对下载接口进行实现,代码如下
/// <summary> /// 继承CEF文件下载接口,并实现 jhd_006 2018-5-24 15:06:20 /// </summary> public class DownloadHandler : IDownloadHandler { public void OnBeforeDownload(IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback) { if (!callback.IsDisposed) { using (callback) { callback.Continue(downloadItem.SuggestedFileName, showDialog: true); } } } public void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { } }