Print error messages

This commit is contained in:
Cheng Zhao 2016-11-16 09:51:43 +09:00 committed by Kevin Sawicki
parent a1066617a8
commit 18fca785c4

View file

@ -190,6 +190,8 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', function (event, guestI
const guestWindow = getGuestWindow(guestId)
if (guestWindow != null && canAccessWindow(event.sender, guestWindow.webContents)) {
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)) {
event.returnValue = guestWindow[method].apply(guestWindow, args)
} else {
console.error(`Blocked ${event.sender.getURL()} from calling ${method} of its opener.`)
event.returnValue = null
}
})
@ -219,5 +222,7 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', function (event,
const guestContents = webContents.fromId(guestId)
if (guestContents != null && canAccessWindow(event.sender, guestContents)) {
guestContents[method].apply(guestContents, args)
} else {
console.error(`Blocked ${event.sender.getURL()} from calling ${method} of its opener.`)
}
})