Is it possible to display a custom message in the beforeunload popup?

You can’t set custom messages anymore in most modern browsers
In order to set a confirmation message before the user is closing the window, you can use

jQuery

$(window).bind("beforeunload",function(event) {
    return "You have some unsaved changes";
});

Javascript

window.onbeforeunload = function() {
    return "Leaving this page will reset the wizard";
};

It’s important to notice that you can’t put confirm/alert inside beforeunload

A few more notes:

Safari
Firefox
Chrome
IE