Displaying a custom dialog when the user exits the browser?
问题 Yes, I realize this is horrible UI and bad accessibility wise, but I am forced to seek out the options due to contracted work ( to which I didn't initially agree upon and am stuck with ). I know that you can assign an event handler to onbeforeunload like: window.onbeforeunload = function() { return 'You have unsaved changes!'; } That would bring about a dialog generated by the OS/browser which cannot be customized. It would ask you to Cancel your request or go on. So far it seems the only way