window.win = window.open("open.html", "_blank");
var timerID = setInterval(function(){
if(window.win && window.win.closed){
console.log("clearInterval:"+timerID); clearInterval(timerID);
return;
}
if(window.win.document && window.win.document.URL && window.win.document.URL.toLowerCase().substr(0,4) == "http"){
$(window.win.document).on("keyup",function(e) {
console.log("keyCode:"+e.which);
if (e.ctrlKey && e.which == 67){//ctrl+c
window.win.opener = null; window.win.close(); window.win = null;
}
});
console.log("clearInterval:"+timerID); clearInterval(timerID);
}
}, 500);