mirror of
https://github.com/electron/electron.git
synced 2026-01-27 16:28:23 -05:00
Add comment why defaultPrevented = false
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user