Browser: Default page title to URL if no title is provided
This commit is contained in:
parent
aab022b77b
commit
e639c5bc25
Notes:
sideshowbarker
2024-07-19 07:35:37 +09:00
Author: https://github.com/nicktiberi Commit: https://github.com/SerenityOS/serenity/commit/e639c5bc258 Pull-request: https://github.com/SerenityOS/serenity/pull/1805
1 changed files with 7 additions and 2 deletions
|
@ -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&) {
|
||||
|
|
Loading…
Add table
Reference in a new issue