webview: adding load-commit event

This commit is contained in:
Robo 2015-08-05 17:20:23 +05:30
parent 6b8d4a43a3
commit 0a7a4c0d0a
7 changed files with 27 additions and 4 deletions

View file

@ -157,10 +157,10 @@ class WebViewImpl
enumerable: true
# Updates state upon loadcommit.
onLoadCommit: (@baseUrlForDataUrl, @currentEntryIndex, @entryCount, @processId, url, isTopLevel) ->
onLoadCommit: (webViewEvent) ->
oldValue = @webviewNode.getAttribute webViewConstants.ATTRIBUTE_SRC
newValue = url
if isTopLevel and (oldValue != newValue)
newValue = webViewEvent.url
if webViewEvent.isMainFrame and (oldValue != newValue)
# Touching the src attribute triggers a navigation. To avoid
# triggering a page reload on every guest-initiated navigation,
# we do not handle this mutation