title: Google Chrome Userscripts reference window.open
body: <p>I have been trying to figure this one out for a while, but when I try to reference a window that I opened the handle is always undefined.</p>
  
  <p>It is worth noting that this is being used in a <strong>userscript</strong> and here is the snippet in question:</p>
  
  <pre><code>var donateWindow;
  
  // ######################################################################
  // # Show the donation popup and open a window to paypal site
  // ######################################################################
  function showDonateWindow()
  {
      if (window.confirm("Question here"))
      {
        if (! (typeof(donateWindow) == 'undefined' || donateWindow.closed)) window.donateWindow.close();
        window.donateWindow = window.open("http://somesite.com/","tabName");
      }
  }
  </code></pre>
  
  <p>Any help on this would be very appreciated. It would seem no matter what I do window.open returns the value "undefined".</p>
  
  <p>My goal is to have a popup shown, but if one is already open it should just replaced the old one. This works as expected in FF, but for the life of me I can not get it going in Chrome.</p>