when-exit

Execute a function right before the process, or the browser's tab, is about to exit.