From 9eb03fe9fc70623b31e15caf80feb1a84a8b4ece Mon Sep 17 00:00:00 2001 From: jiang kun Date: Wed, 25 Aug 2021 14:29:55 +0800 Subject: [PATCH 1/2] Update process-model.md the demo have two error: - at macos, close all window, the app will not quite, unless press cmd + q - attach preload.js, use preload prop that is member of `webPreferences` property of `BrowserWindow` controller argument --- docs/tutorial/process-model.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/process-model.md b/docs/tutorial/process-model.md index f8b334b88c0e9..7f54fd6445590 100644 --- a/docs/tutorial/process-model.md +++ b/docs/tutorial/process-model.md @@ -83,7 +83,7 @@ As a practical example, the app shown in the [quick start guide][quick-start-lif uses `app` APIs to create a more native application window experience. ```js title='main.js' -// quitting the app when no windows are open on macOS +// quitting the app when no windows are open on non-macOS app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit() }) @@ -148,7 +148,9 @@ A preload script can be attached to the main process in the `BrowserWindow` cons const { BrowserWindow } = require('electron') //... const win = new BrowserWindow({ - preload: 'path/to/preload.js' + webPreferences: { + preload: 'path/to/preload.js' + } }) //... ``` From 80b52e5f401c2cdb9ff9100d5d82aaa6d89ad6c7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 1 Sep 2021 09:59:14 +0900 Subject: [PATCH 2/2] Update docs/tutorial/process-model.md Co-authored-by: Erick Zhao --- docs/tutorial/process-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/process-model.md b/docs/tutorial/process-model.md index 7f54fd6445590..6b7737ec50b84 100644 --- a/docs/tutorial/process-model.md +++ b/docs/tutorial/process-model.md @@ -83,7 +83,7 @@ As a practical example, the app shown in the [quick start guide][quick-start-lif uses `app` APIs to create a more native application window experience. ```js title='main.js' -// quitting the app when no windows are open on non-macOS +// quitting the app when no windows are open on non-macOS platforms app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit() })