I'm using a page unload trigger to warn the user of unsaved changes while leaving the page/closing the tab/etc... and this works fine.
//Exit event
if (!changes_saved) {
window.onbeforeunload = confirmExit;
}
function confirmExit()
{
return "Your changes will be lost if you leave this page!";
}
My problem is that the browser (both Firefox and IE) enwraps the custom message with "Are you sure you want to navigate away from this page" in the beginning and with "Press OK to continue, or Cancel to stay on current page." at the end.
My question: is there any way to avoid this and completely customize the message in the dialog? Need for this isn't abstract, I'm developing a multi language interface and localized message mixed with the enforced one just looks silly.
Thank you.