Would like to perform an action when the user is about to close the browser tab not when the user clicks the close button. How can it be done in javascript?
Don't want to use unload or beforeunload since it is triggered when the user clicks on close button or when the user navigates to another page.