Code

Close the main process via the renderer in Electron

A close button made in the renderer process of an Electron app

[:fr]A close button made in the renderer process of an Electron app[:]

Not a pain at all, but in Electron, we might want some method to close entirely our software.

We know that we can access our electron’s app via the renderer by calling the object remote. So this is the solution

const app = require('electron').remote.app
app.exit()

If you know a better solution,share it with us in the comments bellow !

Theme by Anders Norén