chore: warn memory leak when using nativeWindowOpen with nodeIntegration
This commit is contained in:
parent
4a5d2117ba
commit
714f3ffd29
1 changed files with 9 additions and 0 deletions
|
@ -48,6 +48,15 @@ BrowserWindow.prototype._init = function () {
|
|||
return
|
||||
}
|
||||
|
||||
if (webContents.getLastWebPreferences().nodeIntegration === true) {
|
||||
const message =
|
||||
'Enabling Node.js integration in child windows opened with the ' +
|
||||
'"nativeWindowOpen" option will cause memory leaks, please turn off ' +
|
||||
'the "nodeIntegration" option.\\n' +
|
||||
'See https://github.com/electron/electron/pull/15076 for more.'
|
||||
this.webContents.executeJavaScript(`console.warn('${message}')`)
|
||||
}
|
||||
|
||||
let {url, frameName} = urlFrameName
|
||||
v8Util.deleteHiddenValue(webContents, 'url-framename')
|
||||
const options = {
|
||||
|
|
Loading…
Add table
Reference in a new issue