var win = window.open("http://www.google.com"); var winClosed = setInterval(function () { if (win.closed) { clearInterval(winClosed); foo(); //Call your function here } }, 250);