Having troubles with onunload, onbeforeunload. I need to execute some code when user navigates away from the page, or browser is closed. onunload works for navigation away, but doesn't work when browser closes. I can't use onbeforeunload, since I inject the script into existing website, and it has confirmation upon leaving, so onbeforeunload is fired before user is asked if he wants to leave, so I can't rely on it.
What should I do?
codewindow.onunload = function() {alert("123")}codeonunload isn't fired, at least not in FF, when you close your browser. - user1617735