Print error messages
This commit is contained in:
parent
a1066617a8
commit
18fca785c4
1 changed files with 5 additions and 0 deletions
|
@ -190,6 +190,8 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', function (event, guestI
|
||||||
const guestWindow = getGuestWindow(guestId)
|
const guestWindow = getGuestWindow(guestId)
|
||||||
if (guestWindow != null && canAccessWindow(event.sender, guestWindow.webContents)) {
|
if (guestWindow != null && canAccessWindow(event.sender, guestWindow.webContents)) {
|
||||||
guestWindow.destroy()
|
guestWindow.destroy()
|
||||||
|
} else {
|
||||||
|
console.error(`Blocked ${event.sender.getURL()} from closing its opener.`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -198,6 +200,7 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_METHOD', function (event, guest
|
||||||
if (guestWindow != null && canAccessWindow(event.sender, guestWindow.webContents)) {
|
if (guestWindow != null && canAccessWindow(event.sender, guestWindow.webContents)) {
|
||||||
event.returnValue = guestWindow[method].apply(guestWindow, args)
|
event.returnValue = guestWindow[method].apply(guestWindow, args)
|
||||||
} else {
|
} else {
|
||||||
|
console.error(`Blocked ${event.sender.getURL()} from calling ${method} of its opener.`)
|
||||||
event.returnValue = null
|
event.returnValue = null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -219,5 +222,7 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', function (event,
|
||||||
const guestContents = webContents.fromId(guestId)
|
const guestContents = webContents.fromId(guestId)
|
||||||
if (guestContents != null && canAccessWindow(event.sender, guestContents)) {
|
if (guestContents != null && canAccessWindow(event.sender, guestContents)) {
|
||||||
guestContents[method].apply(guestContents, args)
|
guestContents[method].apply(guestContents, args)
|
||||||
|
} else {
|
||||||
|
console.error(`Blocked ${event.sender.getURL()} from calling ${method} of its opener.`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue