mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
Browser: Call url_from_user_input for home URL
This allows omitting HTTP scheme in home URLs.
This commit is contained in:
parent
5d8cda59ae
commit
d3fc3337ef
2 changed files with 3 additions and 3 deletions
|
@ -102,7 +102,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
|||
};
|
||||
|
||||
m_window_actions.on_create_new_tab = [this] {
|
||||
create_new_tab(Browser::g_home_url, true);
|
||||
create_new_tab(Browser::url_from_user_input(Browser::g_home_url), true);
|
||||
};
|
||||
|
||||
m_window_actions.on_next_tab = [this] {
|
||||
|
@ -171,7 +171,7 @@ void BrowserWindow::build_menus()
|
|||
|
||||
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { active_tab().go_back(); }, this);
|
||||
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { active_tab().go_forward(); }, this);
|
||||
m_go_home_action = GUI::CommonActions::make_go_home_action([this](auto&) { active_tab().load(g_home_url); }, this);
|
||||
m_go_home_action = GUI::CommonActions::make_go_home_action([this](auto&) { active_tab().load(Browser::url_from_user_input(g_home_url)); }, this);
|
||||
m_go_home_action->set_status_tip("Go to home page");
|
||||
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { active_tab().reload(); }, this);
|
||||
m_reload_action->set_status_tip("Reload current page");
|
||||
|
|
|
@ -92,7 +92,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(load_content_filters());
|
||||
|
||||
URL first_url = Browser::g_home_url;
|
||||
URL first_url = Browser::url_from_user_input(Browser::g_home_url);
|
||||
if (specified_url) {
|
||||
if (Core::File::exists(specified_url)) {
|
||||
first_url = URL::create_with_file_protocol(Core::File::real_path_for(specified_url));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue