From ce2803f3547c16764cc9d5a51c5f78940f889bcb Mon Sep 17 00:00:00 2001 From: daboe01 Date: Wed, 12 Aug 2026 16:58:12 +0200 Subject: [PATCH] replace unload event listener with pagehide and add DOM safety checks --- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index 961fb4787..20413329b 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -481,7 +481,7 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio _DOMWindow.addEventListener("blur", onBlurEventCallback, NO); _DOMWindow.addEventListener("focus", onFocusEventCallback, NO); - _DOMWindow.addEventListener("unload", function() + _DOMWindow.addEventListener("pagehide", function() { _DOMWindow.removeEventListener("unload", arguments.callee, NO);