Obviously, window.onbeforeunload has encountered its fair share of problems with Chrome as I\'ve seen from all the problems I\'ve encountered. What\'s the most recent work a
$(window).on('beforeunload', function() {
return "You should keep this page open.";
});
The returned message can be anything you want, including the empty string if you have nothing to add to the message that Chrome already shows. The result looks like this: