ximmyxiao
ximmyxiao

Reputation: 2811

iOS WKWebView 's didCommitNavigation never called?

In my test code , I open the http://www.qq.com/ with a WKWebView . And I found that ,there will be 3 delegate methods to be called:

webView:(WKWebView *)webView decidePolicyForNavigationAction:
webView:(WKWebView *)webView didStartProvisionalNavigation:
webView:(WKWebView *)webView didFinishNavigation:

And these two method will never be called

webView:(WKWebView *)webView decidePolicyForNavigationResponse:
webView:(WKWebView *)webView didCommitNavigation:

And I want to know what make the method to be called or not ?

Upvotes: 0

Views: 497

Answers (1)

ximmyxiao
ximmyxiao

Reputation: 2811

OK, I found the reason here: it's because my webview is using the WebViewJavaScriptBridge , and this bridge cause the two method will not be called . so if u need these two method to working ,do it as follows https://blog.csdn.net/zyx980193917/article/details/107064789

Upvotes: 1

Related Questions