javascript - postMessage to sandboxed iframe, why is recipient window origin null?
2 postMessage calls in the test: 1 using an asterisk for targetOrigin, one using the same https url of both the parent and child documents. button 1: $('.iframed')[0].contentWindow.postMessage( messageData , '*' ); button 2: $('.iframed')[0].contentWindow.postMessage( messageData , 'https://myurl.net' ); the iframe element in parent html document, which points to child html file on same domain, in same directory: <iframe name="childFrame" class="iframed" src="child.html" sandbox="allow-scripts"></iframe> both documents are fully loaded before I am clicking the buttons to trigger postMessage. =