http的iframe中访问https页面简单解决办法
在公司云平台(微信企业号及公众号管理)上需要显示其他公众号微信文章,正常来说直接在富文本编辑器中设置超连接是没问题的,但是微信文章是https开头,而服务器http开头,导致页面报错:
Refused to display 'https://mp.weixin.qq/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>
更多推荐
Refused to display because an ancestor violates the following Content Security问题
发布评论