closedO funcionamento deste script depende das configurações do navegador para janelas popup.
<script type="text/javascript">
var janelaAberta = window.open('','','width=400,height=200');
function testarJanela() {
if (janelaAberta.closed) {
alert('A janela foi fechada');
} else {
alert('A janela está aberta');
};
}
</script>
<button type="button" onclick="testarJanela()">Testar janela</button>