我有一个页面,用JS创建一个简单的iframe
document.createElement('iframe');我可以让他们这样做
frames['x'].postMessage(...);现在,由于Opera Mini是特别的,我一直在尝试做一个postMessage到iframe,但没有运气。我尝试的每一件事都有相同的例外:
Uncaught exception: ReferenceError: Securiry error: attempted to read protected variable是的,当我试图摆弄frame对象时,就会发生异常。
有人遇到过这个问题吗?
提前感谢
发布于 2016-04-13 16:37:31
这是Opera Mini服务器端的一个bug,导致跨域postMessage问题。修复它是在我们的积压中,但不幸的是,我不能给出它何时会发生的预计时间。如果您正在创建的iframe使用您自己提供的内容,您可以考虑将其托管在主文档所在的域上-这样postMessage就应该像预期的那样工作-就像这个简单的测试用例:https://dev.opera.com/articles/window-postmessage-messagechannel/crossdocmessaging.html。
https://stackoverflow.com/questions/36338765
复制相似问题