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.
|
||||
const mergeBrowserWindowOptions = function (embedder, options) {
|
||||
if (options.webPreferences == null) {
|
||||
options.webPreferences = {}
|
||||
}
|
||||
if (embedder.browserWindowOptions != null) {
|
||||
// Inherit the original options if it is a BrowserWindow.
|
||||
mergeOptions(options, embedder.browserWindowOptions)
|
||||
} else {
|
||||
// Or only inherit web-preferences if it is a webview.
|
||||
if (options.webPreferences == null) {
|
||||
options.webPreferences = {}
|
||||
}
|
||||
mergeOptions(options.webPreferences, embedder.getWebPreferences())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue