Selaa lähdekoodia

Browser: Support opening a URL from the command line at startup

Conrad Pankoff 5 vuotta sitten
vanhempi
commit
15a016d3e3
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      Applications/Browser/main.cpp

+ 6 - 1
Applications/Browser/main.cpp

@@ -94,7 +94,12 @@ int main(int argc, char** argv)
     window->set_main_widget(widget);
     window->show();
 
-    html_widget->load("file:///home/anon/www/welcome.html");
+    String url_to_load = "file:///home/anon/www/welcome.html";
+
+    if (app.args().size() >= 1)
+        url_to_load = app.args()[0];
+
+    html_widget->load(url_to_load);
 
     return app.exec();
 }