Crossbrowser onbeforeunload?
I found a workaround for Firefox with setTimeout function because it does not have the same behaviour as other web browsers. window.onbeforeunload = function (e) { var message = “Are you sure ?”; var firefox = /Firefox[\/\s](\d+)/.test(navigator.userAgent); if (firefox) { //Add custom dialog //Firefox does not accept window.showModalDialog(), window.alert(), window.confirm(), and window.prompt() furthermore var dialog … Read more