Steps to reproduce
I have two web pages - Host and Child (see attached). The Host web page is hosted on a server that is on my local network. The Child page is hosted on my computer. The Host page opens up the child page, using “localhost” in a window.open() call. The Child page then posts a message back to the Host page using the window.postMessage() method (https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage).
In IE and Chrome, the postMessage() works from the “localhost” page to the page that is hosted on the other server. In Edge, it does not work. The “message” event is not even fired on the host page.
Now, if I put the Host page on a server that is not on my local network, the postMessage() method does work and the “message” event is fired. IE had a concept of intranet vs. internet sites, and I wonder if Edge has the same concept except that there is no way of configuring it.
Is there anything I’m doing here that isn’t allowed in Edge. I don’t see why this should be blocked due to security, because postMessage() is a secure way to perform messaging between pages on different domains.
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “Steven K.”
There is another bug report that I believe is blocking your test scenario. The opener object is undefined for new windows/pop-ups and so the message does not get sent.
As a workaround can you try your test using an inline iFrame?
Steven K, I have confirmed that yes - the
window.openerobject is undefined in Edge. I will look into the inline iframe option.