I've seen a lot of question on this and the solution seems to be
window.onbeforeunload
But i've tried it, seems to work great to warn the user before the pages unload, but there is no way i've seems to be able to set the message in the message box.
i've tried this :
window.onbeforeunload = function (){ return "test";}
But I've got the default message of the browser.
I'm using the french version of firefox 8.0
Thanks all