summaryrefslogtreecommitdiff
path: root/Applications/Browser/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-11 23:08:37 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-11 23:11:10 +0200
commit8ef9c272b6ad7dfee9ab28ab3a3e6d5154fb1f80 (patch)
tree6426da1687f7a49d73d242c48d90159e9df74662 /Applications/Browser/main.cpp
parentb1555381eecbc6e909716313a0a57fc10767a7cd (diff)
downloadserenity-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.cpp10
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);