Skip to content

Instantly share code, notes, and snippets.

@t4t5
Last active May 9, 2022 18:46
Show Gist options
  • Save t4t5/169727139514a81c603646a7de2044b4 to your computer and use it in GitHub Desktop.
Save t4t5/169727139514a81c603646a7de2044b4 to your computer and use it in GitHub Desktop.
Electron: Hide window instead of quitting when closing it
// Hide window instead of quitting when closing it:
win = new BrowserWindow({ width: 500, height: 500 })
win.on('close', e => {
e.preventDefault() // Prevents quit
win.hide()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment