Try to clarify docs for window.onbeforeunload()
This commit is contained in:
parent
6494ed6b13
commit
ab98dcd7cf
1 changed files with 3 additions and 3 deletions
|
@ -131,9 +131,9 @@ window.onbeforeunload = function(e) {
|
||||||
console.log('I do not want to be closed');
|
console.log('I do not want to be closed');
|
||||||
|
|
||||||
// Unlike usual browsers, in which a string should be returned and the user is
|
// Unlike usual browsers, in which a string should be returned and the user is
|
||||||
// prompted to confirm the page unload. Electron gives the power completely
|
// prompted to confirm the page unload, Electron gives developers more options.
|
||||||
// to the developers, return empty string or false would prevent the unloading
|
// Returning empty string or false would prevent the unloading now.
|
||||||
// now. You can also use the dialog API to let user confirm it.
|
// You can also use the dialog API to let the user confirm closing the application.
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue