Allow navigating to the same url with a different fragment
This commit is contained in:
parent
36fda4d51f
commit
1726a7c711
|
@ -163,6 +163,13 @@ extension ReadViewController: WKNavigationDelegate {
|
|||
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy {
|
||||
if navigationAction.navigationType == .linkActivated {
|
||||
let url = navigationAction.request.url!
|
||||
if url.fragment != nil {
|
||||
var components = URLComponents(url: url, resolvingAgainstBaseURL: false)!
|
||||
components.fragment = nil
|
||||
if components.url == item.url {
|
||||
return .allow
|
||||
}
|
||||
}
|
||||
present(createSafariVC(url: url), animated: true)
|
||||
return .cancel
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue