Close app from jQuery listener


#1

I am looking to close the application when the user interacts with a DOM element using jQuery. If I try to jquery from main.js I get jQuery not defined and if I try to reference app from my loaded app.js file I get app is not defined.

$('#element').on('click', function( {
   app.quit();
});

#2

Check out the remote module.


#3

Wouldn’t work for some reason, went with ipc instead. I like that it keeps the renderer and the main process separate in concern.


#4

you should do a call using ipc to the main js file, over there you kill the app, not on BrowserWindow.