Omit extra transfer of new-window event

This commit is contained in:
Cheng Zhao 2015-06-23 16:34:22 +08:00
parent 2d65c3bcd0
commit 015ef3e014
4 changed files with 20 additions and 18 deletions

View file

@ -30,17 +30,6 @@ wrapWebContents = (webContents) ->
do (name, method) ->
webContents[name] = -> method.apply controller, arguments
# Translate |disposition| to string for 'new-window' event.
webContents.on '-new-window', (args..., disposition) ->
disposition =
switch disposition
when 2 then 'default'
when 4 then 'foreground-tab'
when 5 then 'background-tab'
when 6, 7 then 'new-window'
else 'other'
@emit 'new-window', args..., disposition
# Tell the rpc server that a render view has been deleted and we need to
# release all objects owned by it.
webContents.on 'render-view-deleted', (event, processId, routingId) ->