Delay the did-fail-provisional-load event to next tick
Chrome is doing some stuff after the DidFailProvisionalLoad event, if we call LoadURL at this time crash would happen.
This commit is contained in:
parent
0f17a0163d
commit
1b3eb1cc5d
2 changed files with 8 additions and 3 deletions
|
@ -70,6 +70,12 @@ wrapWebContents = (webContents) ->
|
|||
menu = Menu.buildFromTemplate params.menu
|
||||
menu.popup params.x, params.y
|
||||
|
||||
# This error occurs when host could not be found.
|
||||
webContents.on 'did-fail-provisional-load', (args...) ->
|
||||
# Calling loadURL during this event might cause crash, so delay the event
|
||||
# until next tick.
|
||||
setImmediate => @emit 'did-fail-load', args...
|
||||
|
||||
# Deprecated.
|
||||
deprecate.rename webContents, 'loadUrl', 'loadURL'
|
||||
deprecate.rename webContents, 'getUrl', 'getURL'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue