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.
This commit is contained in:
Eran Tiktin 2015-08-18 19:34:14 +03:00
parent 0efdb448b6
commit 129d92b30a

View file

@ -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;
};
```