From ed7181ba2427115bb6e17af72c8e1f692a02a8ec Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 29 Aug 2023 16:36:04 +0200 Subject: [PATCH] Remove custom message from onbeforeunload event It's not supported anymore by browsers. --- umap/static/umap/js/umap.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 77c9431b..742e3aab 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -267,13 +267,7 @@ L.U.Map.include({ if (L.Util.queryString('download')) this.download() }) - window.onbeforeunload = (e) => { - const msg = L._('You have unsaved changes.') - if (self.isDirty) { - e.returnValue = msg - return msg - } - } + window.onbeforeunload = () => this.isDirty || null this.backup() this.initContextMenu() this.on('click contextmenu.show', this.closeInplaceToolbar)