From 129d92b30acc2a778b65dc139f113cf10511c4f7 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Tue, 18 Aug 2015 19:34:14 +0300 Subject: [PATCH] Update browser-window.md Update the `beforeunload` example to use `e.returnValue = false` instead of `return false`, since `e.returnValue` always works while the `return` works only in certain conditions. See #2481 for details. --- docs/api/browser-window.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 612b3ce4f3f..dda22e58667 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -141,7 +141,7 @@ window.onbeforeunload = function(e) { // prompted to confirm the page unload, Electron gives developers more options. // Returning empty string or false would prevent the unloading now. // You can also use the dialog API to let the user confirm closing the application. - return false; + e.returnValue = false; }; ```