aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2024-08-14 12:13:14 +0200
committerJan200101 <sentrycraft123@gmail.com>2024-08-14 12:13:14 +0200
commit29e7a323d26e985f47015ad8b64315fe8afa5b72 (patch)
treebec030ba19d67acde286d9980f186cc032864ffb
parent027b9dfb30d2ac09e555a3311b9ce37783c1ca9f (diff)
downloadViper-29e7a323d26e985f47015ad8b64315fe8afa5b72.tar.gz
Viper-29e7a323d26e985f47015ad8b64315fe8afa5b72.zip
feat: parse commandLine of secondary instances
-rw-r--r--src/index.js5
-rw-r--r--src/modules/protocol.js4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/index.js b/src/index.js
index d8107e8..ab15039 100644
--- a/src/index.js
+++ b/src/index.js
@@ -128,4 +128,9 @@ if (cli.hasArgs()) {
app.on("ready", () => {
start();
})
+
+ app.on('second-instance', (event, commandLine, workingDirectory, additionalData) => {
+ protocol(commandLine);
+ })
+
}
diff --git a/src/modules/protocol.js b/src/modules/protocol.js
index a40b67e..7f2f7c0 100644
--- a/src/modules/protocol.js
+++ b/src/modules/protocol.js
@@ -3,11 +3,11 @@ const { app } = require("electron");
const win = require("../win");
const version = require("./version");
-module.exports = async () => {
+module.exports = async (argv) => {
if (version.northstar() == "unknown")
return;
- const args = process.argv.slice(app.isPackaged ? 1 : 2);
+ const args = argv || process.argv;
for (const key of args) {
if (key.startsWith("ror2mm://")) {