From 6058f4d9ab6f534b430e28868036ce90e48866d9 Mon Sep 17 00:00:00 2001 From: Brandon T Date: Mon, 30 Dec 2024 10:43:22 -0500 Subject: [PATCH] Use the source frame's origin info in the external app alert --- .../BrowserViewController/BVC+WKNavigationDelegate.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift index c762471ce4ee..861a8fde813a 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift @@ -1228,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) }