diff --git a/lib/browser/guest-window-manager.js b/lib/browser/guest-window-manager.js index 3ff307ea7c24..d0fa3cd4e23b 100644 --- a/lib/browser/guest-window-manager.js +++ b/lib/browser/guest-window-manager.js @@ -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()) }