Use "in" over "on"

This commit is contained in:
Jessica Lord 2015-09-04 13:44:40 -07:00
parent bd264aa1ba
commit b797804fd9
5 changed files with 7 additions and 6 deletions

View file

@ -53,7 +53,7 @@ server that you are requesting updates from. A common approach is to use query
parameters, like this: parameters, like this:
```javascript ```javascript
// On the main process // In the main process
var app = require('app'); var app = require('app');
var autoUpdater = require('auto-updater'); var autoUpdater = require('auto-updater');
autoUpdater.setFeedUrl('http://mycompany.com/myapp/latest?version=' + app.getVersion()); autoUpdater.setFeedUrl('http://mycompany.com/myapp/latest?version=' + app.getVersion());

View file

@ -1,7 +1,7 @@
# power-monitor # power-monitor
The `power-monitor` module is used to monitor power state changes. You can The `power-monitor` module is used to monitor power state changes. You can
only use it on the main process. You should not use this module until the `ready` only use it in the main process. You should not use this module until the `ready`
event of the `app` module is emitted. event of the `app` module is emitted.
For example: For example:

View file

@ -5,13 +5,13 @@ Electron and third-party node modules also fully supported as well (including
the [native modules](../tutorial/using-native-node-modules.md)). the [native modules](../tutorial/using-native-node-modules.md)).
Electron also provides some extra built-in modules for developing native Electron also provides some extra built-in modules for developing native
desktop applications. Some modules are only available on the main process, some desktop applications. Some modules are only available in the main process, some
are only available in the renderer process (web page), and some can be used in are only available in the renderer process (web page), and some can be used in
both processes. both processes.
The basic rule is: if a module is The basic rule is: if a module is
[GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) or low-level [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) or low-level
system related, then it should be only available on the main process. You need system related, then it should be only available in the main process. You need
to be familiar with the concept of to be familiar with the concept of
[main process vs. renderer process](../tutorial/quick-start.md#the-main-process) [main process vs. renderer process](../tutorial/quick-start.md#the-main-process)
scripts to be able to use those modules. scripts to be able to use those modules.

View file

@ -445,7 +445,7 @@ page can handle it by listening to the `channel` event of the `ipc` module.
An example of sending messages from the main process to the renderer process: An example of sending messages from the main process to the renderer process:
```javascript ```javascript
// On the main process. // In the main process.
var window = null; var window = null;
app.on('ready', function() { app.on('ready', function() {
window = new BrowserWindow({width: 800, height: 600}); window = new BrowserWindow({width: 800, height: 600});
@ -472,6 +472,6 @@ app.on('ready', function() {
**Note:** **Note:**
1. The IPC message handler in web pages does not have an `event` parameter, 1. The IPC message handler in web pages does not have an `event` parameter,
which is different from the handlers on the main process. which is different from the handlers in the main process.
2. There is no way to send synchronous messages from the main process to a 2. There is no way to send synchronous messages from the main process to a
renderer process, because it would be very easy to cause dead locks. renderer process, because it would be very easy to cause dead locks.

View file

@ -25,6 +25,7 @@ These are the ways that we construct the Electron documentation.
- Line length is 80-column wrapped. - Line length is 80-column wrapped.
- Platform specific methods are noted in italics following method header. - Platform specific methods are noted in italics following method header.
- ```### `method(foo, bar)` _OS X_``` - ```### `method(foo, bar)` _OS X_```
- Prefer 'in the ___ process' over 'on'
## Reading Electron Documentation ## Reading Electron Documentation