Files
cefsharp/CefSharp.Example/CefSharpSchemeHandlerFactory.cs
T
amaitland abb06171b6 Add basic example of reading the Debug.log file from disk and add option to use ResourceHandler in a SchemeHandlerFactory
(Means that ISchemeHandler had to be removed - which is an unfortunate breaking change, better to be done now though)
2015-07-29 20:55:28 +10:00

17 lines
625 B
C#

namespace CefSharp.Example
{
internal class CefSharpSchemeHandlerFactory : ISchemeHandlerFactory
{
public const string SchemeName = "custom";
public IResourceHandler Create(IBrowser browser, IFrame frame, string schemeName, IRequest request)
{
if(schemeName == SchemeName && request.Url.EndsWith("debug.log", System.StringComparison.OrdinalIgnoreCase))
{
//Display the debug.log file in the browser
return ResourceHandler.FromFileName("Debug.log", ".txt");
}
return new CefSharpSchemeHandler();
}
}
}