Add comment why defaultPrevented = false
This commit is contained in:
parent
de2019f6b8
commit
9edfbab89f
1 changed files with 2 additions and 0 deletions
|
@ -247,6 +247,8 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', function (event
|
|||
if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) {
|
||||
if (newGuest !== undefined && newGuest !== null) {
|
||||
if (options.webContents === newGuest.webContents) {
|
||||
// the webContents is not changed, so set defaultPrevented to false to
|
||||
// stop the callers of this event from destroying the webContents.
|
||||
event.defaultPrevented = false
|
||||
}
|
||||
event.returnValue = setupGuest(event.sender, frameName, newGuest, options)
|
||||
|
|
Loading…
Add table
Reference in a new issue