I'm wondering what methods could be used to detect when a browser window, or tab just before it is closed?
I'm guessing there are a few ways, but I'm not sure of the best.
I've seen spam sites that give a pop up window saying "are you sure you want to exit" before the browser window will close. Anyone know how to achieve this in code? Would javascript be the only/best solution?
Tracking the mouse (when it moves to top right hand corner) might be a good way, again in probably only in javascript?
Perhaps cookies can do this?
Any thoughts or suggestions would be wonderful.