CEF 跨域访问iframe

转载:https://www.cnblogs.com/wxxweb/p/3738696.html

在CefBrowserSettings也就是_cef_browser_settings_t结构体中,有个成员变量web_security,来看下它的注释

///
  // Controls whether web security restrictions (same-origin policy) will be
  // enforced. Disabling this setting is not recommend as it will allow risky
  // security behavior such as cross-site scripting (XSS). Also configurable
  // using the "disable-web-security" command-line switch.
  ///
  cef_state_t web_security;

1.将其赋值为true,即可运行跨域访问

2.命令行设置

command_line->AppendSwitch("--disable-web-security");//关闭同源策略

猜你喜欢

转载自www.cnblogs.com/chechen/p/10289000.html
CEF