title: onbeforeunload with a popup, that redirects via header
body: <p>I have this script:</p>
  
  <pre><code>function LinkedINAuth() {
      linkedInAuthWindow=window.open(root_url+'ajax-connect.php?social-login&amp;auto-close&amp;method=linkedin&amp;auth','LinkedIN Auth','height=200,width=150');
      if (window.focus) {linkedInAuthWindow.focus()}
  
      linkedInAuthWindow.onbeforeunload = function(){
          CheckLinkedINUser();
      }
      return false;
  }
  </code></pre>
  
  <p>If the pop-up page isnt redirected, the function <code>linkedInAuthWindow.onbeforeunload</code> works perfectly. So when I then close the window, the <code>CheckLinkedINUser()</code> function is fired.</p>
  
  <p>However, when the popup has redirected the user (to i.e. LinkedIN) and I then close the popup window, the event is not fired.</p>
  
  <p>For instance; if the user closes the window when LinkedIN requests for permission, I would like to track this.</p>