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