How to be notified when a window created using window.open is closed?
<p>I tried:  </p>

<pre><code>var sub_window = window.open(url);
sub_window.onunload = function(){
    console.log("sub window closed");
};
</code></pre>

<p>but it didn't work...</p>
