From c7c72ede5d3b59e911644bb739f23381bc271ebb Mon Sep 17 00:00:00 2001 From: Philip Walton Date: Thu, 23 Jul 2020 18:20:43 -0700 Subject: [PATCH] Remove the unload listener --- src/lib/onHidden.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/onHidden.ts b/src/lib/onHidden.ts index 7aff3a59..f7d3ab0c 100644 --- a/src/lib/onHidden.ts +++ b/src/lib/onHidden.ts @@ -30,10 +30,10 @@ const onPageHide = (event: PageTransitionEvent) => { const addListeners = () => { addEventListener('pagehide', onPageHide); - // Unload is needed to fix this bug: + // `beforeunload` is needed to fix this bug: // https://bugs.chromium.org/p/chromium/issues/detail?id=987409 // eslint-disable-next-line @typescript-eslint/no-empty-function - addEventListener('unload', () => {}); + addEventListener('beforeunload', () => {}); } export const onHidden = (cb: OnHiddenCallback, once = false) => {