render: executejavascript with option to simulate usergesture

This commit is contained in:
Robo 2015-07-30 14:42:03 +05:30
parent 2ab079dc7d
commit 239d535cac
7 changed files with 40 additions and 8 deletions

View file

@ -46,11 +46,11 @@ wrapWebContents = (webContents) ->
# web contents has been loaded.
webContents.loaded = false
webContents.once 'did-finish-load', -> @loaded = true
webContents.executeJavaScript = (code) ->
webContents.executeJavaScript = (code, hasUserGesture=false) ->
if @loaded
@_executeJavaScript code
@_executeJavaScript code, hasUserGesture
else
webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code)
webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code, hasUserGesture)
# The navigation controller.
controller = new NavigationController(webContents)