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");//关闭同源策略

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM