Skip to content

Commit

Permalink
Use the source frame's origin info in the external app alert
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T committed Dec 30, 2024
1 parent 0b7a115 commit 6058f4d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 6058f4d

Please sign in to comment.