Use webView.backForwardList.currentItem.URL if webView.URL is nil.
It is possible for WKWebView.URL to be empty inside webView:didCommitNavigation:. That's probably a bug, but WKWebView.URL does not represent last committed URL anyway, so it is safer to fallback to WKBackForwardList's currentItem when WKWebView.URL is nil. Using webView.backForwardList.currentItem.URL everywhere is not an option because that URL is not correct for WebUI pages loaded via loadHTML:. After dropping iOS 10 and switching WebUI to iOS 11's custom URL protocols it might be possible to use webView.backForwardList.currentItem.URL unconditionally. Bug: 784480 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I2c2cdb9fad425afec6756bc8e841389e979d066b Reviewed-on: https://chromium-review.googlesource.com/773621 Commit-Queue: Eugene But <eugenebut@chromium.org> Reviewed-by:Kurt Horimoto <kkhorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#518355}
Showing
Please register or sign in to comment