diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 35a693d92829..e28d593ab79d 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -310,7 +310,7 @@ and allow the page to be unloaded. const { BrowserWindow, dialog } = require('electron') const win = new BrowserWindow({ width: 800, height: 600 }) win.webContents.on('will-prevent-unload', (event) => { - const choice = dialog.showMessageBox(win, { + const choice = dialog.showMessageBoxSync(win, { type: 'question', buttons: ['Leave', 'Stay'], title: 'Do you want to leave this site?',