- Electron Tutorial
- Electron - Home
- Electron - Overview
- Electron - Installation
- How Electron Works?
- Electron - Hello World
- Electron - Building UIs
- Electron - File Handling
- Electron - Native Node Libraries
- Inter Process Communication(IPC)
- Electron - System Dialogs
- Electron - Menus
- Electron - System Tray
- Electron - Notifications
- Electron - Webview
- Electron - Audio & Video Capturing
- Electron - Defining Shortcuts
- Electron - Environment Variables
- Electron - Debugging
- Electron - Packaging Apps
- Electron - Resources
How Electron Works
Electron takes a main file defined in your package.json file and executes it. This main file creates application windows which contain rendered web pages and interaction with the native GUI (graphical user interface) of your Operating System.
As you start an application using Electron, a main process is created. This main process is responsible for interacting with the native GUI of the Operating System. It creates the GUI of your application.
The main process can access the native GUI through modules available directly in Electron. The desktop application can access all Node modules like the file system module for handling files, request to make HTTP calls, etc.
Difference between Main and Renderer processes
The main process creates web pages by creating the BrowserWindow instances. Each BrowserWindow instance runs the web page in its own renderer process. When a BrowserWindow instance is destroyed, the corresponding renderer process is also terminated.
The main process manages all web pages and their corresponding renderer processes. Each renderer process is isolated and only cares about the web page running in it.
Kickstart Your Career
Get certified by completing the courseGet Started