From 506bc4db4ce2742dc8c23d6ac9ed3fa7f1aca967 Mon Sep 17 00:00:00 2001 From: sourenaraya Date: Sun, 5 Jun 2016 20:39:10 +1000 Subject: [PATCH] Fix shared data example since `remote` module unaviable --- docs/faq/electron-faq.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/faq/electron-faq.md b/docs/faq/electron-faq.md index cefc5a54a2..1e96d47c21 100644 --- a/docs/faq/electron-faq.md +++ b/docs/faq/electron-faq.md @@ -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 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 // In the main process. @@ -41,12 +41,12 @@ global.sharedObject = { ```javascript // In page 1. -require('remote').getGlobal('sharedObject').someProperty = 'new value'; +require('electron').remote.getGlobal('sharedObject').someProperty = 'new value'; ``` ```javascript // 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.