fix: load window-setup in sandboxed renderer (#21416)
This commit is contained in:
parent
d56f67b7af
commit
31c93fec67
7 changed files with 89 additions and 61 deletions
|
@ -75,8 +75,10 @@ const mergeBrowserWindowOptions = function (embedder, options) {
|
|||
}
|
||||
}
|
||||
|
||||
// Sets correct openerId here to give correct options to 'new-window' event handler
|
||||
options.webPreferences.openerId = embedder.id
|
||||
if (!webPreferences.nativeWindowOpen) {
|
||||
// Sets correct openerId here to give correct options to 'new-window' event handler
|
||||
options.webPreferences.openerId = embedder.id
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
|
|
@ -112,11 +112,15 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
|
|||
contentScripts = getContentScripts()
|
||||
}
|
||||
|
||||
const webPreferences = event.sender.getLastWebPreferences() || {}
|
||||
|
||||
return {
|
||||
contentScripts,
|
||||
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
|
||||
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
|
||||
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),
|
||||
guestInstanceId: webPreferences.guestInstanceId,
|
||||
openerId: webPreferences.openerId,
|
||||
process: {
|
||||
arch: process.arch,
|
||||
platform: process.platform,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue