我收到错误:
Refused to frame 'http://localhost:8888/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
当尝试从包含另一个本地 HTML 文件的 iframe 的本地 HTML 文件创建 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 IFrame
IFrame(src='test-outer.html', width=200, height=200)
test-inner.html可以包含任何东西。
test-outer.html在单独的浏览器选项卡上完美加载。问题在于将其加载到 Jupyter Notebook 中。
潇潇雨雨
相关分类