зеркало из https://github.com/electron/electron.git
Return null in window.open if failed to open new window, fixes #1067
This commit is contained in:
Родитель
8947d54cc9
Коммит
4217b70331
|
@ -42,7 +42,11 @@ window.open = (url, frameName='', features='') ->
|
|||
options.height ?= 600
|
||||
|
||||
guestId = ipc.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', url, frameName, options
|
||||
new FakeWindow(guestId)
|
||||
if guestId
|
||||
new FakeWindow(guestId)
|
||||
else
|
||||
console.error 'It is not allowed to open new window from this WebContents'
|
||||
null
|
||||
|
||||
# Use the dialog API to implement alert().
|
||||
window.alert = (message, title='') ->
|
||||
|
|
Загрузка…
Ссылка в новой задаче