feat: warn when remote is used without enableRemoteModule: true (#21546)

* feat: warn when remote is used without enableRemoteModule: true

* fix security warning
This commit is contained in:
Jeremy Apthorp 2020-01-12 22:23:03 -08:00 committed by Cheng Zhao
parent 2f394d46c7
commit 2e1531ad90
4 changed files with 14 additions and 7 deletions

View file

@ -321,7 +321,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
const isRemoteModuleEnabledImpl = function (contents: electron.WebContents) {
const webPreferences = (contents as any).getLastWebPreferences() || {}
return !!webPreferences.enableRemoteModule
return webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true
}
const isRemoteModuleEnabledCache = new WeakMap()