Especially when important things need to be saved, all browsers are suitable for use:
window.isCloseHint = true;
//Initialize closing
window.addEventListener("beforeunload", function(e) {
if (window.isCloseHint) {
var confirmationMessage = "Remember to save! Are you sure you want to leave me?";
(e || window.event).returnValue = confirmationMessage; // Compatible with Gecko + IE
return confirmationMessage; // Compatible with Gecko + Webkit, Safari, Chrome
}
Favorite a clip that closes the browser window and is compatible with various browsers
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326685468&siteId=291194637
Ranking