Why does onbeforeunload, always return the default statement, why does the custom statement not work?

window.onbeforeunload = function (e) {
        var message = "";
        e = e || window.event;
    
        if (e) {
            e.returnValue = message;
        }
    
        return message;
    };
window.onbeforeunload = function (e) {
  e = e || window.event;

  // IE8Firefox 4
  if (e) {
    e.returnValue = "";
  }

  // Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
  return "";
};
<body onbeforeunload="return myfunction()">
 
<script>
function myfunction() {
    return "";
}
</script>

none of these three ways works, only the browser"s default prompt "OK to leave." Ie,chrome,360,edge can"t even display custom content?

Apr.11,2021

not someone has already told you your last question. The new version of the browser beforeunload will no longer display custom content.

starting with Firefox 4, Chrome 51, Opera 38, and Safari 9.1, the generic confirmation message replaces the string returned by the event.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3e0a0-44781.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3e0a0-44781.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?