Return null in window.open if failed to open new window, fixes #1067
This commit is contained in:
parent
8947d54cc9
commit
4217b70331
1 changed files with 5 additions and 1 deletions
|
@ -42,7 +42,11 @@ window.open = (url, frameName='', features='') ->
|
||||||
options.height ?= 600
|
options.height ?= 600
|
||||||
|
|
||||||
guestId = ipc.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', url, frameName, options
|
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().
|
# Use the dialog API to implement alert().
|
||||||
window.alert = (message, title='') ->
|
window.alert = (message, title='') ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue