render: executejavascript with option to simulate usergesture
This commit is contained in:
parent
2ab079dc7d
commit
239d535cac
7 changed files with 40 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue