Here is some code that I wrote. I tried setting the MessageEvent
's origin to *
, but I'm still getting an error in the console saying "Blocked a frame with origin "AAAA" from accessing a frame with origin "BBBB". Protocols, domains, and ports must match.". Any ideas on why this might be happening?
var size = {
width: document.body.scrollWidth,
height: document.body.scrollHeight
}
var evt = new MessageEvent("dimensionMessage",{
"data": size,
"origin":"*"
});
window.parent.dispatchEvent(evt);
Interestingly, when I use
window.parent.postMessage(size, "*")
, it seems to work without any issues.