summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 03e9b036..f5294cb0 100644
--- a/src/app.c
+++ b/src/app.c
@@ -339,6 +339,22 @@ static void init_App_(iApp *d, int argc, char **argv) {
339 postCommandString_App(i.value); 339 postCommandString_App(i.value);
340 } 340 }
341 } 341 }
342 /* URLs from the command line. */ {
343 iBool newTab = iFalse;
344 for (size_t i = 1; i < size_StringList(args_CommandLine(&d->args)); i++) {
345 const iString *arg = constAt_StringList(args_CommandLine(&d->args), i);
346 const iBool isKnownScheme =
347 startsWithCase_String(arg, "gemini:") || startsWithCase_String(arg, "file:") ||
348 startsWithCase_String(arg, "data:") || startsWithCase_String(arg, "about:");
349 if (isKnownScheme || fileExists_FileInfo(arg)) {
350 postCommandf_App("open newtab:%d url:%s%s",
351 newTab,
352 isKnownScheme ? "" : "file://",
353 cstr_String(arg));
354 newTab = iTrue;
355 }
356 }
357 }
342} 358}
343 359
344static void deinit_App(iApp *d) { 360static void deinit_App(iApp *d) {