2

I need an electron event handler that detects a force quit/end task from task manager in windows. I would like this event handler to be able to send an http request before ending the program. I am currently using:

   app.on('before-quit', function () {
       //send http request...
   })

to handle the force quit event. While this handler works with force quit in mac environment, it does not get fired in windows using the task manager.

  • I'm not sure if it will work but I think the `'will-quit'` event is worth a shot https://electronjs.org/docs/api/app#event-will-quit – Joshua Oct 02 '18 at 02:21
  • Every `xy-quit` event says "On Windows, this event will not be emitted if the app is closed due to a shutdown/restart of the system or a user logout." - I'm afraid you're out of luck with this :/ – pergy Oct 02 '18 at 08:41
  • Tried the will-quit a while ago, but didn't work... That is unfortunate. Thanks for the help guys – user8887477 Oct 02 '18 at 12:20

0 Answers0