Return message on window.onbeforeunload custom message didn't set. it shows always default message
<p>I had tried to return my custom message to onbeforeunload confirm box, but default message didn't change what I sent.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>    window.onbeforeunload  = function (event) {
        event.preventDefault();
        return 'You are leaving this page. Please confirm or data will be lost';
};</code></pre>
</div>
</div>
</p>

<p>This Changes worked on Firefox 46.0.1
<a href="https://i.stack.imgur.com/MZn3A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MZn3A.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/liz6w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/liz6w.png" alt="enter image description here"></a></p>