Default webPreferences to empty object always
This commit is contained in:
parent
4d7050553c
commit
09e5035ab5
1 changed files with 3 additions and 3 deletions
|
@ -24,14 +24,14 @@ const mergeOptions = function (child, parent) {
|
||||||
|
|
||||||
// Merge |options| with the |embedder|'s window's options.
|
// Merge |options| with the |embedder|'s window's options.
|
||||||
const mergeBrowserWindowOptions = function (embedder, options) {
|
const mergeBrowserWindowOptions = function (embedder, options) {
|
||||||
|
if (options.webPreferences == null) {
|
||||||
|
options.webPreferences = {}
|
||||||
|
}
|
||||||
if (embedder.browserWindowOptions != null) {
|
if (embedder.browserWindowOptions != null) {
|
||||||
// Inherit the original options if it is a BrowserWindow.
|
// Inherit the original options if it is a BrowserWindow.
|
||||||
mergeOptions(options, embedder.browserWindowOptions)
|
mergeOptions(options, embedder.browserWindowOptions)
|
||||||
} else {
|
} else {
|
||||||
// Or only inherit web-preferences if it is a webview.
|
// Or only inherit web-preferences if it is a webview.
|
||||||
if (options.webPreferences == null) {
|
|
||||||
options.webPreferences = {}
|
|
||||||
}
|
|
||||||
mergeOptions(options.webPreferences, embedder.getWebPreferences())
|
mergeOptions(options.webPreferences, embedder.getWebPreferences())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue