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

 

转载于:https://www.cnblogs.com/chechen/p/10289000.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值