Hi Jack
Thanks, that got me started. I looked into the samples and tried to construct a class based on what I found. This is what I came up with:
public class CEFTest : IRequestHandler
{
public WebView view;
public CEFTest(string _URL)
{
CefSharp.BrowserSettings browserSettings = new CefSharp.BrowserSettings();
view = new CefSharp.WinForms.WebView("", browserSettings);
view.RequestHandler = this;
if (view.IsBrowserInitialized)
{
view.Load(_URL);
}
}
public bool OnBeforeBrowse(IWebBrowser browser, IRequest request, NavigationType naigationvType, bool isRedirect)
{
return true;
}
public bool OnBeforeResourceLoad(IWebBrowser browser, IRequestResponse requestResponse)
{
return true;
}
public void OnResourceResponse(IWebBrowser browser, string url, int status, string statusText, string mimeType, System.Net.WebHeaderCollection headers)
{
}
}
When I call the CEFTest constructor from my app, IsBrowserInitialized is always false. If I don't have this check, the Load method fails with "Browser not initialized". If I set the URL into the WebView constructor, this wont make a difference. I guess the WebView is missing some initialize part, which it would probably normally get from an app initialier for added components.