I have this code, I have set the MessageEvent
's origin to *
, but still the console prompts Blocked a frame with origin "AAAA" from accessing a frame with origin "BBBB". Protocols, domains, and ports must match. Anyone know why?
var size = {
width: document.body.scrollWidth,
height: document.body.scrollHeight
}
var evt = new MessageEvent("dimensionMessage",{
"data": size,
"origin":"*"
});
window.parent.dispatchEvent(evt);
However, if I use window.parent.postMessage(size, "*")
, it works.