Default webPreferences to empty object always

This commit is contained in:
Samuel Attard 2016-10-07 11:45:13 +11:00
parent 4d7050553c
commit 09e5035ab5
No known key found for this signature in database
GPG key ID: 273DC1869D8F13EF

View file

@ -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())
}