diff options
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 1bcc20c..92f3b7d 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -793,7 +793,16 @@ void BrowserTab::updatePageTitle() { if (page_title.isEmpty()) { - page_title = this->current_location.toString(); + // Use document filename as title instead. + page_title = this->current_location.path(); + auto parts = page_title.split("/"); + page_title = parts[parts.length() - 1]; + + if (page_title.isEmpty()) + { + // Just use the hostname if we can't find anything else + page_title = this->current_location.host(); + } } // TODO: Shorten lengthy titles? |
