title: Detect when a popup is closed
body: <p>I have a popup made with:</p>
  <pre><code>var popup = window.open(URL, ...) //content of popup is not in my control
  </code></pre>
  <p>I want to know when the popup is closed, and thought the below code could help me.</p>
  <pre><code>$(popup).unload()
  </code></pre>
  <p>However, Firefox initiates the unload event when the popup appears, not when it's closed!</p>
  <p>Is there a reliable way to know when a popup is closed, by the opener?</p>
  <p>I don't particularly like polling the popup asking every (say) 500ms if it's closed...</p>
  <p>(I found this solution on <a href="https://stackoverflow.com/questions/3846553/how-to-know-when-popup-is-closed-in-javascript">How to know when popup is closed in javascript</a>)</p>