Electron MOOC Notes
The main process
Rendering process
Process of communication
Project – Local player
The Electron Geek Time Notes
Relationship between the main process and the renderer
Electron architecture
The main process
Rendering process
The API module
App: It manages the life cycle of our app, such as exiting. It can also set some properties of the app itself, such as the Dock.
BrowerWindow: is used to manage our window.
IpcMain: It communicates IPC with the ipcRenderer
Menu/Tray: These are our native GUIs including MenuItem and so on
Notification: Allows us to make an interactive Notification
WebContents: is used to load our specific pages
AutoUpdater: This is our update module
GlobalShortcut: A shortcut used to set global
Clipboard: It is used to access and it is used to read and write our clipboard
CrashReporter: this is used to monitor whether our main and renderer processes have crashed
Remote: You can call our main process module. Do not use it
DesktopCapture: is used to capture our desktop streams, through this module we can get system screenshots, a video stream of the screen, etc
The purpose of Electron interprocess communication
Notification event: For example, we want to create a native menu in the page, but only the main process can create the native menu, so only through IPC inter-process communication, to let the main process create our menu
Data transfer: For example, IF I want to get the current memory status of a page, I need to transfer the data through IPC
Sharing data: for example, our user data, which will be used in various processes, requires IPC communication to complete data sharing
IPC module communication
Interprocess communication: from the renderer to the main process
Interprocess communication: from the main process to the renderer
Page to page (renderer to renderer) communication
Experience and Skills
We need to set a time limit when responding. When the application times out, we need to directly respond to an abnormal timeout event for business to process, and then do the corresponding interaction.
Electron applies native capabilities
Create the native GUI using the Electron API
Use the Electron API to obtain the underlying capabilities
Use Node.js for low-level capabilities
Invoke native modules using Node.js
OS calling capability
The ability of Electron
Front-end imagination
Electron netease Cloud class notes
The first Electron application
Respond to events
Activate works only on Mac systems