fix: do not double-declare webPreferences (#23223)
This commit is contained in:
parent
c798a6e5d1
commit
9d60cfa6fc
1 changed files with 2 additions and 2 deletions
|
@ -220,8 +220,8 @@ const canAccessWindow = function (sender, target) {
|
|||
// Routed window.open messages with raw options
|
||||
ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', (event, url, frameName, features) => {
|
||||
// This should only be allowed for senders that have nativeWindowOpen: false
|
||||
const webPreferences = event.sender.getLastWebPreferences();
|
||||
if (webPreferences.nativeWindowOpen || webPreferences.sandbox) {
|
||||
const lastWebPreferences = event.sender.getLastWebPreferences();
|
||||
if (lastWebPreferences.nativeWindowOpen || lastWebPreferences.sandbox) {
|
||||
event.returnValue = null;
|
||||
throw new Error('GUEST_WINDOW_MANAGER_WINDOW_OPEN denied: expected native window.open');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue