diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/html.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/html.cpp b/Userland/html.cpp index 34b5339102..a72de4bcde 100644 --- a/Userland/html.cpp +++ b/Userland/html.cpp @@ -40,10 +40,12 @@ int main(int argc, char** argv) auto app = GUI::Application::construct(argc, argv); auto f = Core::File::construct(); + URL url; bool success; if (argc < 2) { success = f->open(STDIN_FILENO, Core::IODevice::OpenMode::ReadOnly, Core::File::ShouldCloseFileDescription::No); } else { + url = URL::create_with_file_protocol(argv[1]); f->set_filename(argv[1]); success = f->open(Core::IODevice::OpenMode::ReadOnly); } @@ -56,7 +58,7 @@ int main(int argc, char** argv) auto window = GUI::Window::construct(); auto& widget = window->set_main_widget<Web::InProcessWebView>(); - widget.load_html(html, URL()); + widget.load_html(html, url); if (!widget.document()->title().is_null()) window->set_title(String::format("%s - HTML", widget.document()->title().characters())); else |