window.onbeforeunload in Chrome: what is the most recent fix?
Obviously, window.onbeforeunload has encountered its fair share of problems with Chrome as I’ve seen from all the problems I’ve encountered. What’s the most recent work around? The only thing I’ve got even close to working is this: However, if I substitute return “alert” with something like alert(“blah”), I get nothing from Chrome. I saw in this question that Google purposefully
How can I override the OnBeforeUnload dialog and replace it with my own?
I need to warn users about unsaved changes before they leave a page (a pretty common problem). This works but it raises a default dialog with an irritating standard message that wraps my own text. I need to either completely replace the standard message, so my text is clear, or (even better) replace the entire dialog with a modal dialog