Hi,
I have created project with cefshar with simple downlaod funcationality to download an image.
LoadError is getting triggered before download is complete. is this a default behavior?
Here is the code:
chromiumWebBrowser.LoadError += BrowserLoadError;
LifeSpanHandler:
public bool OnBeforePopup(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser)
{
browser.MainFrame.LoadUrl(targetUrl);
newBrowser = null;
return true;
}
DownloadHandler:
var folderBrowser = new FolderBrowserDialog();
folderBrowser.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
if (folderBrowser.ShowDialog() == true)
{
if (!callback.IsDisposed)
{
using (callback)
{
var downloadPath = Path.Combine(folderBrowser.SelectedPath, downloadItem.SuggestedFileName);
callback.Continue(downloadPath, showDialog: false);
}
}
}