我正在尝试将一个简单的 iframe 加载到我的网页之一,但它没有显示。我在 Chrome 中收到此错误:
Refused to display 'https://cw.na1.hgncloud.com/crossmatch/index.do' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://cw.na1.hgncloud.com".
Invalid 'X-Frame-Options' header encountered when loading 'https://cw.na1.hgncloud.com/crossmatch/index.do': 'ALLOW-FROM https://cw.na1.hgncloud.com' is not a recognized directive. The header will be ignored.
这是我的 iframe 的代码:
<p><iframe src="https://cw.na1.hgncloud.com/crossmatch/" width="680" height="500" frameborder="0"></iframe></p>
我不太确定那是什么意思。我以前加载过很多 iframe,但从未收到过此类错误。
有任何想法吗?
原文由 Jose M. 发布,翻译遵循 CC BY-SA 4.0 许可协议
这意味着位于
cw.na1.hgncloud.com
的 http 服务器发送一些 http 标头来告诉像 Chrome 这样的网络浏览器允许 iframe 加载该页面( https://cw.na1.hgncloud.com/crossmatch/ )仅来自在同一域 (cw.na1.hgncloud.com) 上托管的页面:你应该阅读: