Skip to content

Instantly share code, notes, and snippets.

@jbleuzen
Created October 18, 2016 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbleuzen/3ab2ec5bae831a0b984036b463812fa9 to your computer and use it in GitHub Desktop.
Save jbleuzen/3ab2ec5bae831a0b984036b463812fa9 to your computer and use it in GitHub Desktop.
const {app} = require('electron')
let myWindow = null
const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
//
//
// ------> We should parse commandLine to retrieve open URI
//
//
if (myWindow) {
if (myWindow.isMinimized()) myWindow.restore()
myWindow.focus()
}
})
if (shouldQuit) {
app.quit()
}
// Create myWindow, load the rest of the app, etc...
app.on('ready', () => {
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment