diff --git a/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs b/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs index 7e0af84da..1373036d8 100644 --- a/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs +++ b/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs @@ -79,6 +79,7 @@ namespace CefSharp.Wpf.Example.Views.Main if (WebBrowser != null) { WebBrowser.ConsoleMessage += OnWebBrowserConsoleMessage; + WebBrowser.LoadError += OnWebBrowserLoadError; } break; @@ -90,6 +91,19 @@ namespace CefSharp.Wpf.Example.Views.Main OutputMessage = e.Message; } + private void OnWebBrowserLoadError(string failedUrl, CefErrorCode errorCode, string errorText) + { + // Don't display an error for downloaded files where the user aborted the download. + if (errorCode == CefErrorCode.Aborted) + return; + + var errorMessage = "