如何处理postMessage错误:无法在“ DOMWindow”上执行“ postMessage”?

时间:2020-04-17 18:46:16

标签: angular iframe 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应用程序提供。

谢谢

0 个答案:

没有答案