feat: disable the remote module by default (#22091)
This commit is contained in:
parent
af631f8204
commit
b77f701aeb
8 changed files with 62 additions and 24 deletions
|
@ -13,14 +13,6 @@ const remoteObjectCache = v8Util.createIDWeakMap()
|
|||
// An unique ID that can represent current context.
|
||||
const contextId = v8Util.getHiddenValue(global, 'contextId')
|
||||
|
||||
ipcRendererInternal.invoke('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES').then(preferences => {
|
||||
if (!preferences.enableRemoteModule) {
|
||||
console.warn('%cElectron Deprecation Warning', 'font-weight: bold', "The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.")
|
||||
}
|
||||
}, (err) => {
|
||||
console.error('Failed to get web preferences:', err)
|
||||
})
|
||||
|
||||
// Notify the main process when current context is going to be released.
|
||||
// Note that when the renderer process is destroyed, the message may not be
|
||||
// sent, we also listen to the "render-view-deleted" event in the main process
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue