默认情况下,如果嵌入本地Web页面,并在页面内部使用iframe来显示一个在线页面,加载的过程中会触发一个未捕获异常,虚函数CefV8ContextHandler::OnUncaughtException被调用,如果搞个控制台窗口来输出异常消息,或者将消息打印到日志中,会是这样: Unsafe JavaScript attempt to access frame with URL file:///F:/Workspace/Project/WebUI_V1.0.0/WebUI/main.html
一般情况WebApi都是跨域请求,没有设置跨域一般会报以下错误 No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:48057' is therefore not allowed access. ASP.net Core 跨域有两种,全局和区域 全局跨域: 打开Startup.cs文件.在ConfigureServices方法中添加以下代码 1