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>

 


免责声明!

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



猜您在找 iframe because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' 解决 Jenkins 中无法展示 HTML 样式的问题,csp问题,Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". 开发chrome插件报错:Refused to execute inline event handler because it violates the following Content Security Policy directive Refused to load the script xxxxxx because it violates the following Content Security Policy directive:"script-src 'self' xxxxxxxxxxxxx" 浏览器安全问题 vscode electron error (Refused to execute inline event handler because it violates the following Content Security Policy directive ... 和 Uncaught ReferenceError: process is not defined) Electron中Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.错误应该怎么解决? because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Note that 'script-src' was not explicitly set, so 'default-s Chrome插件在页面上直接绑定JavaScript事件提示Refused to execute inline event handler because it violates the following Co Electron中提示:Refused to execute inline event handler because it violates
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM