db0a152bc1
* WIP * Use serialization * Rebase windows impl of new app requestSingleInstanceLock parameter * Fix test * Implement posix side * Add backwards compatibility test * Apply PR feedback Windows * Fix posix impl * Switch mac impl back to vector * Refactor Windows impl * Use vectors, inline make_span * Use blink converter * fix: ownership across sequences * Fix upstream merge from Chromium Co-authored-by: deepak1556 <hop2deep@gmail.com>
18 lines
396 B
JavaScript
18 lines
396 B
JavaScript
const { app } = require('electron');
|
|
|
|
app.whenReady().then(() => {
|
|
console.log('started'); // ping parent
|
|
});
|
|
|
|
const gotTheLock = app.requestSingleInstanceLock();
|
|
|
|
app.on('second-instance', (event, args, workingDirectory, data) => {
|
|
setImmediate(() => {
|
|
console.log([JSON.stringify(args), JSON.stringify(data)].join('||'));
|
|
app.exit(0);
|
|
});
|
|
});
|
|
|
|
if (!gotTheLock) {
|
|
app.exit(1);
|
|
}
|