mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-29 20:26:03 +08:00
Return null in window.open if failed to open new window, fixes #1067
This commit is contained in:
@@ -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='') ->
|
||||
|
||||
Reference in New Issue
Block a user