第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

嘗試在 Jupyter Notebook 中創(chuàng)建 iframe 時出現(xiàn)錯誤:

嘗試在 Jupyter Notebook 中創(chuàng)建 iframe 時出現(xiàn)錯誤:

夢里花落0921 2023-10-31 19:18:59
我收到錯誤:Refused to frame 'http://localhost:8888/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".當嘗試從包含另一個本地 HTML 文件的 iframe 的本地 HTML 文件創(chuàng)建 iframe 時。例如test-outer.html:<!DOCTYPE html><html><body><iframe sandbox="allow-scripts" id="0" src="./test-inner.html" width="100" height="100"  frameborder="0"></iframe></body></html>使用 Jupyter Notebook Python 代碼:from IPython.display import IFrameIFrame(src='test-outer.html', width=200, height=200)test-inner.html可以包含任何東西。test-outer.html在單獨的瀏覽器選項卡上完美加載。問題在于將其加載到 Jupyter Notebook 中。
查看完整描述

1 回答

?
瀟瀟雨雨

TA貢獻1833條經驗 獲得超4個贊

雖然這是一個老問題,但是對新求知者有所幫助。

您需要在 jupyter_notebook_config.py 中添加標頭

c.NotebookApp.tornado_settings={'headers': {'Content-Security-Policy': "frame-ancestors self https://my-website-url.com/jupyter "}}

https://my-website-url.com/jupyter是您在其中加載 jupyter 筆記本的 url iFrame。

這適用于 Firefox 和 Chrome。未在 Safari 中測試。


查看完整回答
反對 回復 2023-10-31
  • 1 回答
  • 0 關注
  • 627 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號