only register open-url handler on macos

This commit is contained in:
Michael Telatynski 2020-03-02 16:49:55 +00:00
parent dd45008291
commit 4b8b32c3e5

View File

@ -34,14 +34,14 @@ module.exports = () => {
app.setAsDefaultProtocolClient('riot', process.execPath, [app.getAppPath(), ...args]); app.setAsDefaultProtocolClient('riot', process.execPath, [app.getAppPath(), ...args]);
} }
if (process.platform === 'darwin') {
// Protocol handler for macos // Protocol handler for macos
app.on('open-url', function(ev, url) { app.on('open-url', function(ev, url) {
ev.preventDefault(); ev.preventDefault();
processUrl(url); processUrl(url);
}); });
} else {
// Protocol handler for win32/Linux // Protocol handler for win32/Linux
if (process.platform !== 'darwin') {
app.on('second-instance', (ev, commandLine) => { app.on('second-instance', (ev, commandLine) => {
const url = commandLine[commandLine.length - 1]; const url = commandLine[commandLine.length - 1];
if (!url.startsWith("riot://")) return; if (!url.startsWith("riot://")) return;