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

编程知识 更新时间:2023-04-05 06:21:47

 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问题

本文发布于:2023-04-05 06:21:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/8b3d22a1097c13403345664f1ca719fa.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:简单   ancestor   display   Refused   Security

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 45247文章数
  • 14阅读数
  • 0评论数