When windows are closed, what happens with window.document? Whether it has become null, perhaps you can check it with null.
var popupWindow;
$(document).bind('keyup', function(e){
if(e.which==113 && (!popupWindow || !popupWindow.document)) {
popupWindow = window.open('newPage.htm','_blank','','false');
}
});
source
share