Fix ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN handler
This commit is contained in:
parent
2c7343293a
commit
319a7759d0
1 changed files with 7 additions and 3 deletions
|
@ -242,12 +242,16 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', function (event
|
|||
disposition, options,
|
||||
additionalFeatures, postData) {
|
||||
options = mergeBrowserWindowOptions(event.sender, options)
|
||||
event.sender.emit('new-window', event, url, frameName, disposition, options, additionalFeatures)
|
||||
const newGuest = event.newGuest
|
||||
if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) {
|
||||
const newWindowEvent = {
|
||||
preventDefault: () => newWindowEvent.defaultPrevented = true
|
||||
}
|
||||
event.sender.emit('new-window', newWindowEvent, url, frameName, disposition, options, additionalFeatures)
|
||||
const newGuest = newWindowEvent.newGuest
|
||||
if ((event.sender.isGuest() && !event.sender.allowPopups) || newWindowEvent.defaultPrevented) {
|
||||
if (newGuest !== undefined && newGuest !== null) {
|
||||
event.returnValue = setupGuest(event.sender, frameName, newGuest, options)
|
||||
} else {
|
||||
event.preventDefault()
|
||||
event.returnValue = null
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue