Windows URI handling #121

Merged
alexliebowitz merged 8 commits from windows-linux-uris into master 2017-05-12 22:46:49 +02:00
Showing only changes of commit 980a509260 - Show all commits

View file

@ -193,24 +193,28 @@ function quitNow() {
app.quit(); app.quit();
} }
const isSecondaryInstance = app.makeSingleInstance((argv) => { if (process.platform != 'linux') {
if (win) { // On Linux, this is always returning true due to an Electron bug,
if (win.isMinimized()) { // so for now we just don't support single-instance apps on Linux.
win.restore(); const isSecondaryInstance = app.makeSingleInstance((argv) => {
} if (win) {
win.focus(); if (win.isMinimized()) {
win.restore();
}
win.focus();
if (argv.length >= 2) { if (argv.length >= 2) {
win.webContents.send('open-uri-requested', denormalizeUri(argv[1])); win.webContents.send('open-uri-requested', denormalizeUri(argv[1]));
}
} else if (argv.length >= 2) {
openUri = denormalizeUri(argv[1]);
} }
} else if (argv.length >= 2) { });
openUri = denormalizeUri(argv[1]);
if (isSecondaryInstance) { // We're not in the original process, so quit
quitNow();
return;
} }
});
if (isSecondaryInstance) { // We're not in the original process, so quit
quitNow();
return;
} }
app.on('ready', function(){ app.on('ready', function(){