无法在“DOMWindow"上执行“postMessage":提供的目标源与收件人窗口的源不匹配(“null") [英] Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin ('null')
本文介绍了无法在“DOMWindow"上执行“postMessage":提供的目标源与收件人窗口的源不匹配(“null")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 heroku 中有一个游戏,现在我试图让它在 Facebook 画布中运行,但是,虽然它可以在 Firefox 中运行,但在 Chrome 和 IE 中却不能.
I have a game in heroku, now I'm trying to make it work in Facebook canvas, but, while it works in Firefox, in Chrome and IE doesn't.
IE 显示带有按钮的警告,单击按钮时显示内容.
IE shows a warning with a button, when clicking the button, it shows the content.
在 chrome 中,我收到此错误:
In chrome, I get this error:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://game.herokuapp.com') does not match the recipient window's origin ('null').
怎么了?
推荐答案
确保您(或 Facebook)向其发布消息的目标窗口已完成加载.大多数情况下,我收到此错误的原因是我向其发送消息的 iframe 未能加载.
Make sure the target window that you (or Facebook) is posting a message to, has completed loading. Most of the times I've gotten this error were when an iframe I was sending messages to had failed to load.
这篇关于无法在“DOMWindow"上执行“postMessage":提供的目标源与收件人窗口的源不匹配(“null")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文