Skip to content

Commit

Permalink
allow to open http-proxy-links in browser
Browse files Browse the repository at this point in the history
http-proxies are identified by having a port number;
this is not the case for most http-pages.

however, if the guessing can be wrong,
always offer to open the browser alternatively

counterpart of deltachat/deltachat-android#3435
feature proposal at: https://support.delta.chat/t/in-the-new-android-client-it-is-not-possible-to-click-to-open-urls-with-port-numbers/3327
  • Loading branch information
r10s committed Nov 20, 2024
1 parent 9372141 commit 14b2e99
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deltachat-ios/Coordinator/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ class AppCoordinator: NSObject {

selectAlert.addAction(cancelAction)
selectAlert.addAction(selectAction)
if proxyURL.starts(with: "http") {
selectAlert.addAction(UIAlertAction(title: String.localized("open"), style: .default) { _ in
if let url = URL(string: proxyURL) {
UIApplication.shared.open(url)
}
})
}

viewController.present(selectAlert, animated: true)
}
Expand Down

0 comments on commit 14b2e99

Please sign in to comment.