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:
parent
0efdb448b6
commit
129d92b30a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue