From 4b8b32c3e5dfac48bd4f35ac9d8ef7ff4754de36 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 2 Mar 2020 16:49:55 +0000 Subject: [PATCH] only register open-url handler on macos --- src/protocol.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/protocol.js b/src/protocol.js index de7f0b7..153ff64 100644 --- a/src/protocol.js +++ b/src/protocol.js @@ -34,14 +34,14 @@ module.exports = () => { app.setAsDefaultProtocolClient('riot', process.execPath, [app.getAppPath(), ...args]); } - // Protocol handler for macos - app.on('open-url', function(ev, url) { - ev.preventDefault(); - processUrl(url); - }); - - // Protocol handler for win32/Linux - if (process.platform !== 'darwin') { + if (process.platform === 'darwin') { + // Protocol handler for macos + app.on('open-url', function(ev, url) { + ev.preventDefault(); + processUrl(url); + }); + } else { + // Protocol handler for win32/Linux app.on('second-instance', (ev, commandLine) => { const url = commandLine[commandLine.length - 1]; if (!url.startsWith("riot://")) return;