When implementing "loose unsaved changes" confirmation dialogs you usually use window.onbeforeunload to display default prompt to the
window.onbeforeunload