我为一个 SAP 解决方案 (whatever) 制作了一个组件,通过 iframe 嵌入到报告中。在我将报告部署到 SAP 平台 (BO) 后,我在 Chrome 上遇到了这个错误 (但在 IE 或 FF 上也无法工作):
Uncaught SecurityError: Blocked a frame with origin "http://support.domain.com" from accessing a frame with origin "http://support.domain.com". The frame requesting access set "document.domain" to "domain.com", but the frame being accessed did not. Both must set "document.domain" to the same value to allow access.
该iframe嵌入到我的组件中,因此它应该在与报告相同的域和端口上运行。
我在SO中找到了这篇文章以及另一篇,但这并没有真正帮助我理解我需要做什么。
有没有一种方法可以摆脱这个问题,或者至少绕过这个问题? 谢谢:)
编辑: 主机页面URL:http://support.domain.com/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AbmffWLjCAlFsLj14TjuDWg 调用iframe上属性(并生成错误)的文件的URL:http://support.domain.com/BOE/OpenDocument/1411281523/zenwebclient/zen/mimes/sdk_include/com.domain.ds.extension/res/cmp/js/component.js 框架的URL:http://support.domain.com/BOE/OpenDocument/1411281523/zenwebclient/zen/mimes/sdk_include/com.domain.ds.extension/res/cmp/js/map/js/map.html 该iframe嵌入一些脚本标记,我可以在控制台的网络标记中看到所有加载正常的内容。
也许这能帮助解决问题。
第二次编辑: 我刚意识到SAP报告本身被嵌入到一个iframe中。这意味着我的iframe在一个iframe内部,这可能是问题所在。不过,当从Eclipse启动报告时,一切都正常。