window.onbeforeunload = function (event) { window.opener.location.href = window.opener.location.href; //self.opener.location.reload(true); };