title: Electron: Close w X vs right click dock and quit
body: <p>In my Electron app, I would like to do something that is done very often in other OSX apps. That is... I would like to NOT close the app of the red X is clicked in the top right. But, if they right click the app icon in the dock, and say Quit, then I would like to quit the app. How do I do this?</p>
  
  <p>I have tried using the <code>onbeforeunload</code> event from the rendererProcess, as well as the <code>browserWindow.on("close", fn)</code> event to try and prevent this. The problem is that they both file the <code>onbeforeunload</code> event. And I can't tell the different between the red X being clicked and the dock icon being right clicked and told to quit. Any help would be nice. Has anyone else done this in Electron for OSX?</p>