What is a Electron(.atom.io) ?

Electron

1. It enables you to create desktop applications with PURE JAVASCRIPT!

2. Electron uses web pages as its GUI!

- so you could see it as a minimal chromium controlled by JavaScript!
Hmm,, then what is the difference between desktop app(chromium) and web app?
Good question.
In Normal Browser => Not allowed access to native resources.
Electron => Can use Node.js Apis ALLOWING lower level operating system interactions!
That's the the difference between desktop app built by Electron and web app.

3. There are two processes in Electron.

Main Process  / Renderer Process.
Main Process : creates and manages all Renderer process & BrowserWindow instances that create web page .
Renderer Process : display web pages (Each web page in Electron runs in its own process. - See above picture ! )

4. How can I perform GUI operations in a web page(in a renderer process)?

- Actually, it's the main process that can perform GUI operation. So, the web page in a renderer process can't do it. 
- However, of course , there is a method to perform it. 
- It's request !
- Render process can communicate with main process by sending request through IPC ! (It's ok you don't know IPC now exactly, just think it as a thing that enable renderer process to send a request to main process.)
Like this : 

댓글 없음:

댓글 쓰기