The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
Send messages to parent window using window.parent.postMessage
Recieve messages using window.addEventListener('message')
This does not work when the iFrame domain is not the same as the parent.
The general behavior across browsers for cross origin (root domain) iFrames seems to be:
One way to demo this with free services is to use a mix of code sandbox, runkit and glitch... the latter two don't require accounts to use real containers