Suppose I have three urls:
<html>
<body>
<iframe id="i1"></iframe>
<script>
var contentWindow = document.getElementById('i1').contentWindow;
var oScript = contentWindow.document.createElement('script');
oScript.src = "http://loader.com";
contentWindow.document.childNodes[0].childNodes[1].appendChild(oScript);
</script>
</body>
</html>
var oFrame = document.createElement("iframe");
oFrame.src = "http://www.sf.com";
oFrame.onload = function() {
oFrame.contentWindow.postMessage({ msg: 'hi'}, 'http://sf.com');
}
document.childNodes[0].childNodes[1].appendChild(oFrame);
<html>
<head>
<script>
window.addEventListener('message', function(event) {
document.getElementById('h4').innerHTML = event.origin;
});
</script>
</head>
<body>
<h4 id="h4"></h4>
</body>
</html>
Now in any "normal" browser (edge/firefox/chrome) load the http://home.com - the chain will load script from "http://loader.com" into an iframe which will load yet another iframe with "http://sf.com" and the last iframe will displays "http://home.com" as the event origin. However in internet explorer 11 the event orgin is set to "about:". Is there a way how to get around this particular quirk ? I haven't found any docs around this particular quirk (ref: https://caniuse.com/#search=postMessage)