1// custom message prompt is no more supported (only IE does)
2window.addEventListener("beforeunload", function(e) {
3 if( someBusyFlag )
4 {
5 // ask for stay
6 e.preventDefault();
7 // Chrome requires this var set
8 e.returnValue = '';
9 }
10 else
11 {
12 // grant quit
13 delete e['returnValue'];
14 }
15});