Currently working the latest version of Firefox desktop browser. Trying to capture the window beforeunload event. Below code works for IE, Chrome and Safari but not with Firefox.
window.addEventListener("beforeunload", function(e) {
var confirmationMessage = "Test Test";
e.returnValue = confirmationMessage;
return confirmationMessage;
});