The app module inside the Electron controls your application's event life cycle. This also provides some utility functions that can be used with the main process. This module emits a number of events at various stages of the application's life cycle. This module is essential to initialize your application. Let's go through the some of the functionalities that this module provides, which we did not discuss yet.
Handling and defining a custom protocol is simple with the Electron. However, what if you want to make your application as the default application for specific protocols. If you want to open all the app://someurl
with the application that you are developing, the app module's setAsDefaultProtocolClient
should be used. This can be used in your main process to register your application with a particular protocol; this method works fine on Windows and Mac:
// In your main process app.setAsDefaultProtocolClient...