Skip to content

Commit

Permalink
docs: fix code example in process-model.md (electron#30690)
Browse files Browse the repository at this point in the history
* 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

* Update docs/tutorial/process-model.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
  • Loading branch information
erickzhao and zcbenz committed Sep 1, 2021
1 parent bdf1568 commit 7d9e45e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/tutorial/process-model.md
Expand Up @@ -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 platforms
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
Expand Down Expand Up @@ -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'
}
})
//...
```
Expand Down

0 comments on commit 7d9e45e

Please sign in to comment.