mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 13:35:12 +00:00
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:
parent
b1555381ee
commit
8ef9c272b6
Notes:
sideshowbarker
2024-07-19 07:41:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8ef9c272b6a
1 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue