Browser: Accept file:// URLs on the command line

This could be a lot nicer, but at least we can open file:// URLs now.
This commit is contained in:
Andreas Kling 2020-04-11 23:08:37 +02:00
parent b1555381ee
commit 8ef9c272b6
Notes: sideshowbarker 2024-07-19 07:41:55 +09:00

View file

@ -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);