CefSharp custom SchemeHandler

后端 未结 2 1556
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 16:13

Iam using CefSharp\'s SchemeHandler in order to grab resources from my C# project like .css, .js or .png files using a custom url for

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 17:04

    If you simply need to return a string, then you can use ResourceHandler.FromString(html, mimeType). For this you just need to implement the ISchemeHandlerFactory.

    https://github.com/cefsharp/CefSharp/blob/cefsharp/47/CefSharp/ResourceHandler.cs#L98

    Example reading from a file https://github.com/cefsharp/CefSharp/blob/cefsharp/47/CefSharp.Example/CefSharpSchemeHandlerFactory.cs#L17 which can be translated to reading from a string quite simply.

提交回复
热议问题