зеркало из https://github.com/electron/electron.git
Disable guest node integration when embedder has it disabled
This commit is contained in:
Родитель
fd12e1f506
Коммит
eafe9c245b
|
@ -28,11 +28,6 @@ var mergeBrowserWindowOptions = function (embedder, options) {
|
|||
if (embedder.browserWindowOptions != null) {
|
||||
// Inherit the original options if it is a BrowserWindow.
|
||||
mergeOptions(options, embedder.browserWindowOptions)
|
||||
|
||||
// Disable node integration on child window if disabled on parent window
|
||||
if (embedder.getWebPreferences().nodeIntegration === false) {
|
||||
options.webPreferences.nodeIntegration = false
|
||||
}
|
||||
} else {
|
||||
// Or only inherit web-preferences if it is a webview.
|
||||
if (options.webPreferences == null) {
|
||||
|
@ -40,6 +35,12 @@ var mergeBrowserWindowOptions = function (embedder, options) {
|
|||
}
|
||||
mergeOptions(options.webPreferences, embedder.getWebPreferences())
|
||||
}
|
||||
|
||||
// Disable node integration on child window if disabled on parent window
|
||||
if (embedder.getWebPreferences().nodeIntegration === false) {
|
||||
options.webPreferences.nodeIntegration = false
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче