WKWebView does not call delegate when user click a link

In my code, I found that WebView does not call delegate method

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler

when the user clicks a link, which the href of a tag is a relative path.

This delegate is called if href is a full path.


Is this default behavior? or how can I know that the user click a link with relative path ?

Post not yet marked as solved Up vote post of zxhfirefox Down vote post of zxhfirefox
2.7k views

Replies

Hi, zxhfirefox

A relative path has "#" character at the last path component. (https://www.w3.org/TR/WD-html40-970917/htmlweb.html)

No, # means Fragment, not relative URL

Did you get to the bottom of this? I am curently having the same issue