Example - RegisterTestResources now registers resource if no factory found

This commit is contained in:
amaitland
2020-04-08 18:07:01 +10:00
parent cb429ce9bf
commit ea3b1398d0
+6
View File
@@ -227,7 +227,13 @@ namespace CefSharp.Example
public static async void RegisterTestResources(IWebBrowser browser)
{
if (browser.ResourceRequestHandlerFactory == null)
{
browser.ResourceRequestHandlerFactory = new ResourceRequestHandlerFactory();
}
var handler = browser.ResourceRequestHandlerFactory as ResourceRequestHandlerFactory;
if (handler != null)
{
const string renderProcessCrashedBody = "<html><body><h1>Render Process Crashed</h1><p>Your seeing this message as the render process has crashed</p></body></html>";