I am trying to open a custom popup on browser window/tab close.
In details if a user clicks on the browser window/tab close button a custom popup will appear with some content or may be having some option asking to close or continue the page.
here is the code which only bring the default alert popup:
window.onbeforeunload = function() {
var message = 'Do you want to leave this page?';
return message;
}