title: How to close a popup in Internet Explorer?
body: <p>I need to query a third-party site with ajax. To do so I need cookies, which I retrieve by loading the site's page in a hidden frame. However, I just saw that IE (at least 11) blocks cookies set in frames if the site doesn't provide a P3P policy.</p>
  
  <p>To work around that, I initially thought opening the site in a popup then closing it. But it seems impossible, as the return value of a window.open is <em>null</em> if the url is not from the same domain.</p>
  
  <p>Here's some test code:</p>
  
  <pre><code>var foo = window.open(url);
  setTimeout(function(){
      foo.close(); // fails in IE as foo is null if url is 3rd-party
  }, 2000);
  </code></pre>
  
  <p>I've seen restrictions, such as Window.close can only close windows created with js (or asks confirmation), but I haven't seen anything regarding cross-domain such as my case. BTW, there's no issue with FF and Chrome. Is there any way to do that?</p>