From: Eran Tiktin Date: Tue, 18 Aug 2015 16:34:14 +0000 (+0300) Subject: Update browser-window.md X-Git-Tag: v0.30.5~8^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=129d92b30acc2a778b65dc139f113cf10511c4f7;p=electron.git 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. --- diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 612b3ce4..dda22e58 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; }; ```