Merge pull request #5873 from sourenaraya/patch-1
Fix shared data example in FAQ
This commit is contained in:
commit
08f5322658
1 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@ use HTML5 APIs which are already available in browsers. Good candidates are
|
||||||
|
|
||||||
Or you can use the IPC system, which is specific to Electron, to store objects
|
Or you can use the IPC system, which is specific to Electron, to store objects
|
||||||
in the main process as a global variable, and then to access them from the
|
in the main process as a global variable, and then to access them from the
|
||||||
renderers through the `remote` module:
|
renderers through the `remote` property of `electron` module:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// In the main process.
|
// In the main process.
|
||||||
|
@ -41,12 +41,12 @@ global.sharedObject = {
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// In page 1.
|
// In page 1.
|
||||||
require('remote').getGlobal('sharedObject').someProperty = 'new value';
|
require('electron').remote.getGlobal('sharedObject').someProperty = 'new value';
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// In page 2.
|
// In page 2.
|
||||||
console.log(require('remote').getGlobal('sharedObject').someProperty);
|
console.log(require('electron').remote.getGlobal('sharedObject').someProperty);
|
||||||
```
|
```
|
||||||
|
|
||||||
## My app's window/tray disappeared after a few minutes.
|
## My app's window/tray disappeared after a few minutes.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue