|
@@ -117,9 +117,11 @@ let wrapWebContents = function (webContents) {
|
|
|
hasUserGesture = false
|
|
|
}
|
|
|
if (this.getURL() && !this.isLoadingMainFrame()) {
|
|
|
- return asyncWebFrameMethods.call(this, requestId, 'executeJavaScript', callback, code, hasUserGesture)
|
|
|
+ asyncWebFrameMethods.call(this, requestId, 'executeJavaScript', callback, code, hasUserGesture)
|
|
|
} else {
|
|
|
- return this.once('did-finish-load', asyncWebFrameMethods.bind(this, requestId, 'executeJavaScript', callback, code, hasUserGesture))
|
|
|
+ this.once('did-finish-load', () => {
|
|
|
+ asyncWebFrameMethods.call(this, requestId, 'executeJavaScript', callback, code, hasUserGesture)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|