Route window.open to "new-window" event
This commit is contained in:
parent
94818aef26
commit
389e56ce36
5 changed files with 41 additions and 24 deletions
|
@ -23,6 +23,10 @@ BrowserWindow::_init = ->
|
|||
value: BrowserWindow.windows.add(this)
|
||||
enumerable: true
|
||||
|
||||
# Route the "new-window" event to webContents.
|
||||
@on 'new-window', (args...) =>
|
||||
@webContents?.emit 'new-window', args...
|
||||
|
||||
# Remove the window from weak map immediately when it's destroyed, since we
|
||||
# could be iterating windows before GC happened.
|
||||
@once 'closed', =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue