I want to be able to run a certain piece of code ONLY when the page is exited. I have tried this:
window.onbeforeunload = function(){ new Notification(\'W