Skip to content
New issue

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

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

Already on GitHub? # to your account

[iOS] - Properly handle URL eliding when blobs are given. (uplift to 1.71.x) #26096

Merged
merged 1 commit into from
Oct 21, 2024
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 @@ -450,15 +450,22 @@ class TabLocationView: UIView {
}

private func updateURLBarWithText() {
if let url = url, let internalURL = InternalURL(url), internalURL.isBasicAuthURL {
guard let url = url else {
urlDisplayLabel.text = ""
return
}

if let internalURL = InternalURL(url), internalURL.isBasicAuthURL {
urlDisplayLabel.text = Strings.PageSecurityView.signIntoWebsiteURLBarTitle
} else {
// Matches LocationBarModelImpl::GetFormattedURL in Chromium (except for omitHTTP)
// components/omnibox/browser/location_bar_model_impl.cc
// TODO: Export omnibox related APIs and use directly
urlDisplayLabel.text = URLFormatter.formatURL(
url?.absoluteString ?? "",
formatTypes: [.trimAfterHost, .omitHTTP, .omitHTTPS, .omitTrivialSubdomains],
url.scheme == "blob" ? URLOrigin(url: url).url?.absoluteString ?? "" : url.absoluteString,
formatTypes: [
.trimAfterHost, .omitHTTP, .omitHTTPS, .omitTrivialSubdomains, .omitDefaults,
],
unescapeOptions: .normal
)
}
Expand Down
Loading