The back button event is not recorded window.onbeforeunloador processed by the handler onbeforeunload.
There are several questions that SO asks to grab the back button without a good answer, but still, if the user clicks the back button in the browser when composing a new question on SO, the message box asking him is sure Does he that he wants to continue popping up.
This message box is different from Chrome and FF and looks like native.
So what's behind the curtains?
How can I open a browser window that allows the user to stay on the current page (for example, with onbeforeunload)?
source
share