【发布时间】:2020-07-02 19:13:24
【问题描述】:
这个问题专门针对本地主机。我正在尝试将 localhost 网页嵌入到另一个 localhost 网页中,但是它指出这无法完成。这是 chrome 开发者工具中的消息:
Refused to display 'http://127.0.0.1:4040/jobs/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
我尝试同时使用 firefox 和 chrome。这是来自 Firefox 的错误消息:
Load denied by X-Frame-Options: “SAMEORIGIN” from “http://127.0.0.1:4040/jobs/”, site does not permit cross-origin framing from “http://localhost:8888/lab”.
为什么不认为 localhost 是同源?
如何取消对本地主机的限制?
提前谢谢你。
注意我宁愿在 AJAX 请求上使用 iframe,除非 AJAX 可以像 iframe 那样复制网页。
【问题讨论】:
标签: google-chrome firefox x-frame-options websecurity spark-ui