title: Reload parent window on subdomain from popup
body: <p>How can I reload the parent page in this scenario:</p>
  <pre><code>Parent domain: sub.abc.com
  Popup domain: abc.com
  </code></pre>
  <p>Using <code>window.opener.location.reload();</code> from the popup only works when the domains are equal (should also when the popup is a subdomain of parent).</p>
  <p>I have tried to reload on <code>onunload</code> event in parent:</p>
  <pre><code>var targetWin = window.open(...
  targetWin.onunload = function(){ 
      window.location.reload(); 
  }; 
  </code></pre>
  <p>This triggers too early, probably since the popup redirects.</p>
  <p>I have also tried to explicitly set the domain in parent like this:</p>
  <pre><code>document.domain = &quot;abc.com&quot;;
  </code></pre>
  <p>This has no effect, I still get the error</p>
  <blockquote>
  <p>Unsafe JavaScript attempt to access frame with URL
  http‍://sub.example.com/ from frame with URL http‍://example.com. Domains, protocols and
  ports must match.</p>
  </blockquote>
  <p>Do I have to resort to some hideous polling function to check if <code>targetWin.closed == true</code>?</p>