首页 > 解决方案 > Confluence 无法完全显示 iframe 的内容(CORS 问题)

问题描述

我正在使用托管公共 Grafana 仪表板的“Raintank”网站。这是他们给我的 iframe:

<iframe src="https://snapshot.raintank.io/dashboard-solo/snapshot/lBtQQ...?orgId=2&from=1596254400000&to=1620432682439&panelId=16" width="450" height="200" frameborder="0"></iframe>

我想在 Confluence 中显示这个 iframe,所以在 Confluence 中,我做了“插入更多内容 - 其他宏 - iframe”。我将 iframe 链接放入“https://snapshot.raintank.io/dashboard-solo/snapshot/lBtQQ...?orgId=2&from=1596254400000&to=1620432682439&panelId=16”。

保存后,我看到了部分 iframe 加载(我看到了来自 raintank 站点的加载 gif),但随后它永远加载。查看浏览控制台,我看到:

Access to fetch at 'https://snapshot.raintank.io/img/online.svg' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

知道如何解决这个 CORS 问题吗?

标签: htmliframegrafanaconfluenceconfluence-macros

解决方案


推荐阅读