Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix URLs not opening in active-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T committed Nov 29, 2023
1 parent 429742c commit b197187
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ extension BrowserViewController {
// Finally check non-active tab
let isNonActiveTab = isAboutHome ? false : tab?.url?.host != topToolbar.currentURL?.host

if !isMainFrame || isNonActiveTab {
if !isMainFrame && isNonActiveTab {
openedURLCompletionHandler?(false)
return
}
Expand Down Expand Up @@ -903,7 +903,13 @@ extension BrowserViewController {
}
}
popup.addButton(title: Strings.openExternalAppURLAllow, type: .primary) { [weak tab] () -> PopupViewDismissType in
openedURLCompletionHandler?(true)
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:]) { didOpen in
openedURLCompletionHandler?(!didOpen)
}
} else {
openedURLCompletionHandler?(true)
}
removeTabIfEmpty()
tab?.isExternalAppAlertPresented = false
return .flyDown
Expand Down

0 comments on commit b197187

Please sign in to comment.