angular - 如何处理 postMessage 错误:无法在“DOMWindow”上执行“postMessage”?
问题描述
我在尝试让我的页面在 iFrame 上可用时遇到问题,当它作为 iFrame 包含在另一个页面中时,我收到以下消息:
'未能在'DOMWindow'上执行'postMessage':提供的目标来源(' https://undefined ')与收件人窗口的来源(' https://parent.com.br ')不匹配。
起源确实不同,但与其他帖子不同,我的帖子在消息中变得“未定义”。
iFrame如下:
<iframe src="https://mypage/details"
sandbox=" allow-top-navigation-by-user-activation allow-popups-to-escape-sandbox allow-presentation allow-scripts allow-top-navigation allow-forms allow-modals
allow-pointer-lock allow-popups allow-scripts allow-top-navigation" height="646px" width="100%">
</iframe>
为了能够将其放在 iFrame 上,我应该在我的页面中做些什么吗?
我的页面由 angular-8 应用程序提供。
谢谢
解决方案
推荐阅读
- python - 直接从 Spyder 中的另一个脚本运行 Spyder 中的脚本
- mysql - MySql:如何根据当前周选择记录?
- python - 如何解决“尝试获取锁定时发现死锁;尝试重新启动事务的 Django/MySQL 应用程序
- javascript - 服务器端DataTable rows count函数只返回当前页的总数
- sql - 有没有办法使用 sqlalchemy 引擎在 Python 中加入两个查询的结果?
- r - 用于 plotly boxplot 的自定义 hoverinfo 框
- simulation - R队列模拟:找到一个带有两个参数的函数进程和一个状态,它返回在该状态下花费的时间量
- go - golang FileServer 设置目录
- c# - 在 Post 中将文件和对象传递给正文
- java - 我可以知道何时从 Java 或 Kotlin 调用我的库吗?