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:
parent
2f394d46c7
commit
2e1531ad90
4 changed files with 14 additions and 7 deletions
|
@ -268,7 +268,9 @@ const warnAboutAllowedPopups = function () {
|
|||
// Logs a warning message about the remote module
|
||||
|
||||
const warnAboutRemoteModuleWithRemoteContent = function (webPreferences?: Electron.WebPreferences) {
|
||||
if (!webPreferences || !webPreferences.enableRemoteModule || isLocalhost()) return
|
||||
if (!webPreferences || isLocalhost()) return
|
||||
const remoteModuleEnabled = webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true
|
||||
if (!remoteModuleEnabled) return
|
||||
|
||||
if (getIsRemoteProtocol()) {
|
||||
const warning = `This renderer process has "enableRemoteModule" enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue