Skip to content

Commit

Permalink
Fix tab titles
Browse files Browse the repository at this point in the history
Make them more informative during load, especially when tabs are loading
in background: display the host name.
  • Loading branch information
barijaona committed Nov 17, 2024
1 parent cdb223d commit 0c73dea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Vienna/Sources/Main window/BrowserTab+Interface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ extension BrowserTab {
}

func updateTabTitle() {
if self.url != webView.url || self.url == nil {
if self.url != webView.url || webView.url == nil {
// Currently loading (the first time), webview title not yet correct / available
self.title = self.url?.host ?? NSLocalizedString("New Tab", comment: "")
} else if let title = self.webView.title, !title.isEmpty {
self.title = title
} else {
// Webview is about:blank or empty
} else if (self.title ?? "").isEmpty {
// we haven't yet set a title and Webview is about:blank or empty
self.title = NSLocalizedString("New Tab", comment: "")
}
}
Expand Down

0 comments on commit 0c73dea

Please sign in to comment.