mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
Browser: Fix opening non-file URLs passed in argv
This commit is contained in:
parent
0aeff9c0c4
commit
eacde6c499
Notes:
sideshowbarker
2024-07-19 07:28:51 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/eacde6c4991 Pull-request: https://github.com/SerenityOS/serenity/pull/1866
1 changed files with 2 additions and 7 deletions
|
@ -199,8 +199,7 @@ int main(int argc, char** argv)
|
|||
html_widget.on_title_change = [&](auto& title) {
|
||||
if (title.is_null()) {
|
||||
s_title = html_widget.main_frame().document()->url().to_string();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
s_title = title;
|
||||
}
|
||||
window->set_title(String::format("%s - Browser", s_title.characters()));
|
||||
|
@ -323,11 +322,7 @@ int main(int argc, char** argv)
|
|||
URL url_to_load = home_url;
|
||||
|
||||
if (app.args().size() >= 1) {
|
||||
if (app.args()[0].starts_with("file://")) {
|
||||
url_to_load = URL(app.args()[0]);
|
||||
} else {
|
||||
url_to_load = URL::create_with_file_protocol(app.args()[0]);
|
||||
}
|
||||
url_to_load = URL::create_with_url_or_path(app.args()[0]);
|
||||
}
|
||||
|
||||
html_widget.load(url_to_load);
|
||||
|
|
Loading…
Reference in a new issue