projects
/
platform
/
framework
/
web
/
crosswalk-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e656d84
)
Do not use did-finish-load to detect whether WebContents is ready
author
Cheng Zhao
<zcbenz@gmail.com>
Tue, 15 Sep 2015 01:21:15 +0000
(09:21 +0800)
committer
Cheng Zhao
<zcbenz@gmail.com>
Tue, 15 Sep 2015 01:21:15 +0000
(09:21 +0800)
The WebContents JS object can be created way later after the C++ object
gets created.
atom/browser/api/lib/web-contents.coffee
patch
|
blob
|
history
diff --git
a/atom/browser/api/lib/web-contents.coffee
b/atom/browser/api/lib/web-contents.coffee
index
1bb82de
..
3a2abfb
100644
(file)
--- a/
atom/browser/api/lib/web-contents.coffee
+++ b/
atom/browser/api/lib/web-contents.coffee
@@
-44,10
+44,8
@@
wrapWebContents = (webContents) ->
# Make sure webContents.executeJavaScript would run the code only when the
# web contents has been loaded.
- webContents.loaded = false
- webContents.once 'did-finish-load', -> @loaded = true
webContents.executeJavaScript = (code, hasUserGesture=false) ->
- if @
loaded
+ if @
getUrl() and not @isLoading()
@_executeJavaScript code, hasUserGesture
else
webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code, hasUserGesture)