I am attempting to fire an event on the action of a webpage closing.
The scenario is - a website opens with a separate window, which the user may choose to minimize. This minimized page then waits for the user to either close, or navigate away entirely from the main page before proceeding with a script.
I have looked at the jQuery unload() method, but I don't think it's specific enough i.e. it fires on any kind of navigation (refresh, menu nav etc.)
Is it possible to use this, or another method to achieve this action?