Skip to content

Commit

Permalink
Refactor FXIOS-7586 [v124] Fix deeplink logic (#18539)
Browse files Browse the repository at this point in the history
* Fix deeplink logic

* Remove warning from TODO comment
  • Loading branch information
PARAIPAN9 authored Feb 7, 2024
1 parent ccbbaf0 commit 81fd1c5
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,21 @@ extension BrowserViewController: WKNavigationDelegate {
} else {
webView.customUserAgent = UserAgent.getUserAgent(domain: url.baseDomain ?? "")
}

if navigationAction.navigationType == .linkActivated {
if tab.isPrivate {
decisionHandler(.cancel)
webView.load(navigationAction.request)
return
} else if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { isAppInstalled in
if isAppInstalled {
// TODO: https://mozilla-hub.atlassian.net/browse/FXIOS-7524
}
}
}
}

decisionHandler(.allow)
return
}
Expand Down Expand Up @@ -888,7 +903,7 @@ extension BrowserViewController: WKNavigationDelegate {
}

// When tab url changes after web content starts loading on the page
// We notify the content blocker change so that content blocker status
// We notify the content blocker change so that content blocker status
// can be correctly shown on beside the URL bar
tab.contentBlocker?.notifyContentBlockingChanged()
self.scrollController.resetZoomState()
Expand Down

0 comments on commit 81fd1c5

Please sign in to comment.