From 7d3e65fc14712b612c79178a1ad3d1bfd6d37f6c Mon Sep 17 00:00:00 2001 From: 0xb00bface <0xboobface@gmail.com> Date: Sun, 6 Dec 2020 18:40:12 +0100 Subject: [PATCH] Add parameters to the macOS browser command Add parameters to the open command, so that it waits for the process to end. Otherwise the process returns immediately and causes ctbrec to go on even though the login process didn't run in the browser. Furthermore we now pass on the config dir for the minimal browser as a command line argument --- common/src/main/java/ctbrec/OS.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/ctbrec/OS.java b/common/src/main/java/ctbrec/OS.java index 76f759cc..b97ebb61 100644 --- a/common/src/main/java/ctbrec/OS.java +++ b/common/src/main/java/ctbrec/OS.java @@ -86,10 +86,16 @@ public class OS { System.arraycopy(args, 0, cmd, 1, args.length); break; case MAC: - cmd = new String[args.length + 2]; - cmd[0] = "open"; - cmd[1] = new File(browserDir, "ctbrec-minimal-browser.app").getAbsolutePath(); - System.arraycopy(args, 0, cmd, 2, args.length); + cmd = new String[args.length + 5]; + int index = 0; + cmd[index++] = "open"; + cmd[index++] = "-W"; + cmd[index++] = "-a"; + cmd[index++] = new File(browserDir, "ctbrec-minimal-browser.app").getAbsolutePath(); + if (args.length > 0) { + cmd[index] = "--args"; + System.arraycopy(args, 0, cmd, 5, args.length); + } break; default: throw new UnsupportedOperatingSystemException(System.getProperty(OS_NAME));