Created
September 1, 2016 07:00
-
-
Save justin-caldicott/c20bbd011c250d9f6d226d598cb2b9ff to your computer and use it in GitHub Desktop.
An example of a SchemeHandlerFactory that throws a NRE in 49.0.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CefSharp; | |
namespace BirdJournal.Html.Windows | |
{ | |
public sealed class CustomSchemeHandlerFactory : ISchemeHandlerFactory | |
{ | |
readonly NancyService m_nancyService; | |
public CustomSchemeHandlerFactory(NancyService nancyService) | |
{ | |
m_nancyService = nancyService; | |
} | |
public IResourceHandler Create(IBrowser browser, IFrame frame, string schemeName, IRequest request) | |
{ | |
// Defer to CEF for external requests | |
return request.Url.Contains("localhost") ? new CustomSchemeHandler(m_nancyService) : null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment