From 4b28eca1f6510badb06a32bde1ea14125032821d Mon Sep 17 00:00:00 2001 From: Vladimir Kukushkin Date: Fri, 5 Jan 2024 00:40:18 +0200 Subject: [PATCH] it should be window beforeunload --- .../Resources/MightyTabRefreshInjectedScript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MightyTabRefresh Extension/Resources/MightyTabRefreshInjectedScript.js b/MightyTabRefresh Extension/Resources/MightyTabRefreshInjectedScript.js index 8e77275..c5aa0b8 100644 --- a/MightyTabRefresh Extension/Resources/MightyTabRefreshInjectedScript.js +++ b/MightyTabRefresh Extension/Resources/MightyTabRefreshInjectedScript.js @@ -18,7 +18,7 @@ }); updateVisibilityState(); - document.addEventListener("beforeunload", function(e) { + window.addEventListener("beforeunload", function(e) { safari.extension.dispatchMessage("com.kukushechkin.MightyTabRefresh.scriptPageWillUnload", { url: window.location.href });