confirmation before exit dialog
Why not mention onbeforeunload
? It's the built in way to do so, and I don't see a problem using it.
function myConfirmation() {
return 'Are you sure you want to quit?';
}
window.onbeforeunload = myConfirmation;