Differentiate Unload Events

Differentiate Unload Events

Is there a way to differentiate the unload event? I would like to only execute on a window/tab close or domain change without executing on back/forward/refresh.