From e639c5bc258a458edf2429c327d9ecba54cd4ad9 Mon Sep 17 00:00:00 2001 From: Nick Tiberi Date: Tue, 14 Apr 2020 23:25:36 -0400 Subject: [PATCH] Browser: Default page title to URL if no title is provided --- Applications/Browser/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp index f774e2df0f2..80162fcb493 100644 --- a/Applications/Browser/main.cpp +++ b/Applications/Browser/main.cpp @@ -197,8 +197,13 @@ int main(int argc, char** argv) }; html_widget.on_title_change = [&](auto& title) { - s_title = title; - window->set_title(String::format("%s - Browser", title.characters())); + if (title.is_null()) { + s_title = html_widget.main_frame().document()->url().to_string(); + } + else { + s_title = title; + } + window->set_title(String::format("%s - Browser", s_title.characters())); }; auto focus_location_box_action = GUI::Action::create("Focus location box", { Mod_Ctrl, Key_L }, [&](auto&) {