docs: Document the new style of remote module
This commit is contained in:
parent
94e24abb99
commit
5cacf79bc5
4 changed files with 14 additions and 5 deletions
|
@ -13,7 +13,7 @@ renderer process:
|
|||
|
||||
```javascript
|
||||
const remote = require('electron').remote;
|
||||
const BrowserWindow = remote.require('electron').BrowserWindow;
|
||||
const BrowserWindow = remote.BrowserWindow;
|
||||
|
||||
var win = new BrowserWindow({ width: 800, height: 600 });
|
||||
win.loadURL('https://github.com');
|
||||
|
@ -118,6 +118,15 @@ passed to the main process. This involves cleaning up event handlers, or
|
|||
ensuring the main process is explicitly told to deference callbacks that came
|
||||
from a renderer process that is exiting.
|
||||
|
||||
## Accessing built-in modules in the main process
|
||||
|
||||
The built-in modules in the main process are added as getters in the `remote`
|
||||
module, so you can use them directly like the `electron` module.
|
||||
|
||||
```javascript
|
||||
const app = remote.app;
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
The `remote` module has the following methods:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue