docs: update WebPreferences default values for Electron 12 (#27984)

Updates the values for `contextIsolation` and `worldSafeExecuteJavaScript` for Electron 12.
This commit is contained in:
Erick Zhao 2021-03-07 16:56:50 -08:00 committed by GitHub
parent 46cfb347d7
commit 9ccb8f5910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,7 +339,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
more details. more details.
* `contextIsolation` Boolean (optional) - Whether to run Electron APIs and * `contextIsolation` Boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults the specified `preload` script in a separate JavaScript context. Defaults
to `false`. The context that the `preload` script runs in will only have to `true`. The context that the `preload` script runs in will only have
access to its own dedicated `document` and `window` globals, as well as access to its own dedicated `document` and `window` globals, as well as
its own set of JavaScript builtins (`Array`, `Object`, `JSON`, etc.), its own set of JavaScript builtins (`Array`, `Object`, `JSON`, etc.),
which are all invisible to the loaded content. The Electron API will only which are all invisible to the loaded content. The Electron API will only
@ -351,8 +351,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
context in the dev tools by selecting the 'Electron Isolated Context' context in the dev tools by selecting the 'Electron Isolated Context'
entry in the combo box at the top of the Console tab. entry in the combo box at the top of the Console tab.
* `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values * `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values
can't unsafely cross between worlds when using `contextIsolation`. The default can't unsafely cross between worlds when using `contextIsolation`. Defaults to `true`. _Deprecated_
is `false`. In Electron 12, the default will be changed to `true`. _Deprecated_
* `nativeWindowOpen` Boolean (optional) - Whether to use native * `nativeWindowOpen` Boolean (optional) - Whether to use native
`window.open()`. Defaults to `false`. Child windows will always have node `window.open()`. Defaults to `false`. Child windows will always have node
integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently