I have implemented a script I found online that generates a confirmation message when a user tries to leave a page without submitting a form after making changes.
Here is the script I am using:
<script type="text/javascript">
var formSubmitting = false;
var setFormSubmitting = function() { formSubmitting = true; };
var _isDirty = false;
var setDirtyField = function() { _isDirty = true; }
window.onload = function() {
window.addEventListener("beforeunload", function (e) {
var confirmationMessage = 'Don't forget to fill out the task journal! ';
if (formSubmitting || !_isDirty) {
return undefined;
}
else{
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
}
});
};
</script>
When I use this script in Google Chrome, I see this: https://i.sstatic.net/Ll6a9.png
And when I use it in Mozilla Firefox, I see this: https://i.sstatic.net/o8Ump.png
Does anyone know how I can customize the confirmation message in Firefox? Ideally, replacing the existing text with my own would be perfect.