From a09cfbba989405adbdd08a8f0bcf073ca68489f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Guillaume?= Date: Sun, 18 Feb 2024 04:42:16 +0100 Subject: [PATCH] feat: test beforeunload compatibility --- public/mon-script.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/public/mon-script.js b/public/mon-script.js index 5d95824..eedc176 100644 --- a/public/mon-script.js +++ b/public/mon-script.js @@ -1,16 +1,16 @@ -window.addEventListener('popstate', () => { - confirmFirst('popstate') -}) -window.addEventListener('beforeunload', () => { - confirmFirst('beforeunload') -}) +// window.addEventListener('popstate', () => { +// confirmFirst('popstate') +// }) +// window.addEventListener('beforeunload', () => { +// confirmFirst('beforeunload') +// }) -window.addEventListener('pagehide ', () => { +window.addEventListener('pagehide', () => { confirmFirst('pagehide') }) -confirm('v3') +confirm('v4') function confirmFirst(eventName) { if(confirm("Leave the page?" + eventName)){