diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 612b3ce4f3f0..dda22e586674 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; }; ```