Browse Source

Fix wrong code example for `preload` property (#30872)

The text mentions that `preload` should be a property of `webPreferences`, but the code example shows something else.

Co-authored-by: Christian Engel <[email protected]>
trop[bot] 3 years ago
parent
commit
a2929226d2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      docs/tutorial/process-model.md

+ 3 - 1
docs/tutorial/process-model.md

@@ -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'
+  }
 })
 //...
 ```