Always use |webView.backForwardList.currentItem.URL| inside webView:didCommitNavigation: |
||||
Issue descriptionThis is the right API to get last committed item. Unfortunately that API does not work correctly after loadHTML: (which is used for WebUI) and WKWebView.URL has to be used instead. webView:didCommitNavigation: should switch to |webView.backForwardList.currentItem.URL| once WebUI is not longer relies on loadHTML: I think it's a bug that loadHTML: does not change |webView.backForwardList.currentItem.URL|, because loadHTML is not the same thing as a real navigation.
,
Nov 21 2017
It is a legacy behavior in WebKit that loadHTML doesn't update history session. The short version is that this feature was originally added to support displaying an error page when network request to a URL failed. I think it'll be really hard to change this behavior in WebKit (though probably worth a discussion with them). Another idea: what if we use WKNavigation* to get the URL? WKNavigation* is the definitive identifier of the last committed entry from WKWebView's perspective. We already store additional information associated with WKNavigation* in CRWWKNavigationStates.
,
Nov 21 2017
I would love if WKNavigation had URL and other properties which we have to guess to fill web::NavigationContext! loadHTML: can not be fixed for iOS 10 or 9, but Chrome does not need loadHTML: for WebUI starting from iOS 11 (crrev.com/c/566091). With that I don't think there is much value in asking Apple to fix loadHTML:
,
Oct 26
,
Oct 26
|
||||
►
Sign in to add a comment |
||||
Comment 1 by eugene...@chromium.org
, Nov 21 2017