- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
请问这里的 webView.URL 和 navigationAction.request.URL 有什么区别?
}
- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
请问这里的 webView.URL 和 navigationAction.request.URL 有什么区别?
}
问题:
1.上面代码块里面的问题 webView.URL 和 navigationAction.request.URL 有什么区别?
2.当我第一次加载一个网页的时候,上面的代理方法为什么会被调用多次?
3.如果我想拦截网页的跳转链接,希望通过 push 打开一个页面重新展示一个 webview,最好是在哪个代理方法里拦截? 遇到重定向问题怎么破?
Is it because the url is redirected after calling it multiple times?
You can print them out to see their values and see where they are printed when jumping to the web page.
The documentation contains instructions for these two agents.