cef cefsharp加载网页空白
屏蔽ssl验证即可
Browser.RequestHandler = new ExampleRequestHandler();
public class ExampleRequestHandler : RequestHandler
{
protected override bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
Task.Run(() =>
{
if (!callback.IsDisposed)
{
using (callback)
{
//地址包含报表成分 跳过ssl验证
if (requestUrl.Contains("reportSystem"))
{
callback.Continue(true);//重点部分
}
else
{
callback.Continue(false);
}
}
}
});
return true;
}
}
[参考]
Cefsharp开发中遇到的问题
留待后查,同时方便他人
联系我:renhanlinbsl@163.com
联系我:renhanlinbsl@163.com