Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] - Remove custom popup for tel, facetime, facetime-audio #27099

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ extension BrowserViewController: WKNavigationDelegate {

// First special case are some schemes that are about Calling. We prompt the user to confirm this action. This
// gives us the exact same behaviour as Safari.

if ["sms", "tel", "facetime", "facetime-audio"].contains(requestURL.scheme) {
// tel:, facetime:, facetime-audio:, already has its own native alert displayed by the OS!f
if ["sms", "mailto"].contains(requestURL.scheme) {
let shouldOpen = await handleExternalURL(
requestURL,
tab: tab,
Expand Down Expand Up @@ -262,16 +262,6 @@ extension BrowserViewController: WKNavigationDelegate {
return (shouldOpen ? .allow : .cancel, preferences)
}

// Handles custom mailto URL schemes.
if requestURL.scheme == "mailto" {
let shouldOpen = await handleExternalURL(
requestURL,
tab: tab,
navigationAction: navigationAction
)
return (shouldOpen ? .allow : .cancel, preferences)
}

// handles Decentralized DNS
if let decentralizedDNSHelper = self.decentralizedDNSHelperFor(url: requestURL),
navigationAction.targetFrame?.isMainFrame == true
Expand Down Expand Up @@ -1238,7 +1228,11 @@ extension BrowserViewController {

var alertTitle = Strings.openExternalAppURLGenericTitle

if let displayHost = tab?.url?.withoutWWW.host {
if navigationAction.sourceFrame != nil {
let displayHost =
"\(navigationAction.sourceFrame.securityOrigin.protocol)://\(navigationAction.sourceFrame.securityOrigin.host):\(navigationAction.sourceFrame.securityOrigin.port)"
alertTitle = String(format: Strings.openExternalAppURLTitle, displayHost)
} else if let displayHost = tab?.url?.withoutWWW.host {
alertTitle = String(format: Strings.openExternalAppURLTitle, displayHost)
}

Expand Down
Loading