diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-11 23:08:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-11 23:11:10 +0200 |
commit | 8ef9c272b6ad7dfee9ab28ab3a3e6d5154fb1f80 (patch) | |
tree | 6426da1687f7a49d73d242c48d90159e9df74662 /Applications/Browser/main.cpp | |
parent | b1555381eecbc6e909716313a0a57fc10767a7cd (diff) | |
download | serenity-8ef9c272b6ad7dfee9ab28ab3a3e6d5154fb1f80.zip |
Browser: Accept file:// URLs on the command line
This could be a lot nicer, but at least we can open file:// URLs now.
Diffstat (limited to 'Applications/Browser/main.cpp')
-rw-r--r-- | Applications/Browser/main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp index 30f733ced4..f774e2df0f 100644 --- a/Applications/Browser/main.cpp +++ b/Applications/Browser/main.cpp @@ -318,9 +318,13 @@ int main(int argc, char** argv) URL url_to_load = home_url; if (app.args().size() >= 1) { - url_to_load = URL(); - url_to_load.set_protocol("file"); - url_to_load.set_path(app.args()[0]); + if (app.args()[0].starts_with("file://")) { + url_to_load = URL(app.args()[0]); + } else { + url_to_load = URL(); + url_to_load.set_protocol("file"); + url_to_load.set_path(app.args()[0]); + } } html_widget.load(url_to_load); |