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?