![](https://learn.microsoft.com/media/logos/logo_edge.png)
Please refer to the following paragraph, hope this help:
In older browsers, the return value of the event is displayed in this dialog. Starting with Firefox 44, Chrome 51, Opera 38, and Safari 9.1, a generic string not under the control of the webpage will be shown instead of the returned string.
Link: https://www.w3schools.com/jsref/event_onbeforeunload.asp