mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Dont crash if clicking on a fragment link
If a user clicks on a fragment link like <a href="#info">click here to skip to info</a> we would previously crash because we would reload the bundle. This prevents the crash but the link does not work, we can't just synthesize these links with JS, because the id="info" items are usually removed by readability. To properly handle this, we probably need to preserve some id elements if they are linked to. Then we can scroll to those elements in Javascript.
This commit is contained in:
parent
da4f880ce4
commit
66fc258e0c
1 changed files with 1 additions and 1 deletions
|
|
@ -62,7 +62,7 @@ extension WebReaderCoordinator: WKNavigationDelegate {
|
|||
// swiftlint:disable:next line_length
|
||||
func webView(_: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
|
||||
if navigationAction.navigationType == .linkActivated {
|
||||
if let linkURL = navigationAction.request.url {
|
||||
if let linkURL = navigationAction.request.url, !linkURL.isFileURL {
|
||||
linkHandler(linkURL)
|
||||
}
|
||||
decisionHandler(.cancel)
|
||||
|
|
|
|||
Loading…
Reference in a new issue