How to open a custom popup when tab/window close

Is it possible to show a custom popup element not alert window when a user is about closing a window or the browser or clicking on a link element.

Hi there, @Famous… I have never used it, but you might want to check out this plugin.

Best…
Mike