From 280750dc50deedf939f57b38fe4847a22c6f9ea6 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 3 Jun 2016 16:09:18 -0700 Subject: [PATCH] fix(beforeunload): Chrome 51 - return undefined to continue --- src/window-event-handler.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index b6a8937be..55638f151 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -38,8 +38,10 @@ class WindowEventHandler # Don't hide the window here if we don't want the renderer process to be # throttled in case more work needs to be done before closing - # In Electron, returning false cancels the close. - return @runUnloadCallbacks() + # In Electron, returning any value other than undefined cancels the close. + canCloseWindow = @runUnloadCallbacks() + return undefined if canCloseWindow + return false window.onunload = => NylasEnv.storeWindowDimensions()