Refused to display because an ancestor violates the following Content Security问题简单解决

 http的iframe中访问https页面简单解决办法

在公司云平台(微信企业号及公众号管理)上需要显示其他公众号微信文章,正常来说直接在富文本编辑器中设置超连接是没问题的,但是微信文章是https开头,而服务器http开头,导致页面报错:

Refused to display 'https://mp.weixin.qq.com/xxx' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'

 解决方案:在页面中设置meta ,url可动态设置

 <meta http-equiv="refresh" content="0;url=${contentColumn.URL}">

iframe设置如下:

<iframe src="${contentColumn.URL}" frameborder="0" scrolling="no" style="width: 100%;height: 100%"></iframe>

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值