Is it possible to display a custom message in the beforeunload popup?
<p>When using <code>window.onbeforeunload</code> (or <code>$(window).on(&quot;beforeunload&quot;)</code>), is it possible to display a custom message in that popup?</p>
<p>Maybe a small trick that works on major browsers?</p>
<p>By looking at existing answers I have the feeling this was possible in the past using things like <code>confirm</code> or <code>alert</code> or <code>event.returnValue</code>, but now it seems they are not working anymore.</p>
<p>So, how to display a custom message in the beforeunload popup? Is that even/still possible?</p>