summaryrefslogtreecommitdiff
path: root/Applications/Browser/main.cpp
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2020-04-19 11:33:06 +0300
committerAndreas Kling <kling@serenityos.org>2020-04-19 11:14:26 +0200
commiteacde6c49914bd5b1b8ef307d7cdcfb01c89656a (patch)
treec10abd5f9952379906e122d06ac8444123477d39 /Applications/Browser/main.cpp
parent0aeff9c0c45c086f78af099a7e07a06431347589 (diff)
downloadserenity-eacde6c49914bd5b1b8ef307d7cdcfb01c89656a.zip
Browser: Fix opening non-file URLs passed in argv
Diffstat (limited to 'Applications/Browser/main.cpp')
-rw-r--r--Applications/Browser/main.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp
index 61b751a7e4..b0afac6929 100644
--- a/Applications/Browser/main.cpp
+++ b/Applications/Browser/main.cpp
@@ -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);