File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
docs-translations/zh-CN/tutorial Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,16 @@ Electron 可以让你使用纯 JavaScript 调用丰富的原生 APIs 来创造
11
11
## 渲染进程
12
12
由于 Electron 使用 Chromium 来展示页面,所以 Chromium 的多进程结构也被充分利用。每个 Electron 的页面都在运行着自己的进程,这样的进程我们称之为** 渲染进程** 。
13
13
14
- 在一般浏览器中,网页通常会在沙盒环境下运行,并且不允许访问原生资源。然后 ,Electron 用户拥有在网页中调用 io.js 的 APIs 的能力,从而创造出低等的、与操作系统的交互 。
14
+ 在一般浏览器中,网页通常会在沙盒环境下运行,并且不允许访问原生资源。然而 ,Electron 用户拥有在网页中调用 io.js 的 APIs 的能力,可以与底层操作系统直接交互 。
15
15
16
16
## 主进程与渲染进程的区别
17
- 主进程使用 BroswerWindow 实例创建网页。每个 BroswerWindow 实例都在自己的渲染进程里运行着一个网页。当一个 BroswerWindow 实例被销毁 ,相应的渲染进程也会被终止。
17
+ 主进程使用 BroswerWindow 实例创建网页。每个 BroswerWindow 实例都在自己的渲染进程里运行着一个网页。当一个 BroswerWindow 实例被销毁后 ,相应的渲染进程也会被终止。
18
18
19
19
主进程管理所有页面和与之对应的渲染进程。每个渲染进程都是相互独立的,并且只关心他们自己的网页。
20
20
21
- 由于在网页里管理原生 GUI 资源是非常危险而且容易造成资源泄露的 ,所以在网页面调用 GUI 相关的 APIs 是不被允许的。如果你想在网页里使用 GUI 操作,其对应的渲染进程必须与主进程进行通讯,请求主进程进行相关的 GUI 操作。
21
+ 由于在网页里管理原生 GUI 资源是非常危险而且容易造成资源泄露 ,所以在网页面调用 GUI 相关的 APIs 是不被允许的。如果你想在网页里使用 GUI 操作,其对应的渲染进程必须与主进程进行通讯,请求主进程进行相关的 GUI 操作。
22
22
23
- 在 Electron, 我们提供用于在主进程与渲染进程之间通讯的 [ ipc] [ 1 ] 模块。并且也有一个远程进程调用风格的通讯模块 [ remote] [ 2 ] 。
23
+ 在 Electron, 我们提供用于在主进程与渲染进程之间通讯的 [ ipc] [ 1 ] 模块。并且也有一个远程进程调用风格的通讯模块 [ remote] [ 2 ] 。
24
24
25
25
# 打造你第一个 Electron 应用
26
26
大体上,一个 Electron 应用的目录结构如下:
@@ -133,4 +133,4 @@ $ ./Electron.app/Contents/MacOS/Electron your-app/
133
133
[ 1 ] : https://github.com/atom/electron/blob/master/docs-translations/zh-CN/api/ipc-renderer.md
134
134
[ 2 ] : https://github.com/atom/electron/blob/master/docs-translations/zh-CN/api/remote.md
135
135
[ 3 ] : https://github.com/atom/electron/releases
136
- [ 4 ] : https://github.com/atom/electron/blob/master/docs-translations/zh-CN/tutorial/application-distribution.md
136
+ [ 4 ] : https://github.com/atom/electron/blob/master/docs-translations/zh-CN/tutorial/application-distribution.md
You can’t perform that action at this time.
0 commit comments