title: Failed to execute 'postMessage' on 'Window': Invalid target origin
body: <p>I have the iframe:</p>
  
  <pre><code>&lt;iframe id="GameFrame" 
  sandbox="allow-scripts allow-pointer-lock" 
  src="https://127.0.0.1:112/games/1047/play"&gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <p>My parent page is located at:</p>
  
  <pre><code>https://127.0.0.1/arcade/not-hidden/space-blaster-1047
  </code></pre>
  
  <p>I'm trying to post a message to the iFrame:</p>
  
  <pre><code>var gameIframe = $("#GameFrame");
  gameIframe.get(0).contentWindow.postMessage("screenshot", "");
  </code></pre>
  
  <p>But this throws the error:</p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin '' in a call to 'postMessage'.</p>
  </blockquote>
  
  <p>Other attempts:</p>
  
  <pre><code>postMessage("screenshot", "https://127.0.0.1");
  </code></pre>
  
  <blockquote>
    <p>Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<a href="https://127.0.0.1" rel="noreferrer">https://127.0.0.1</a>') does not match the recipient window's origin ('null').</p>
  </blockquote>
  
  <p>How can I get this posting a message to the iFrame?</p>