Created
February 8, 2016 17:49
-
-
Save zoobab/e53dd443935268a68334 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Hello World!</h1> | |
<script> | |
var remote = require('electron').remote; | |
// show initial value from main process (in dev console) | |
console.log(remote.getGlobal('sharedObj').prop1); | |
// change value of global prop1 | |
var zyrename = remote.getGlobal('sharedObj').prop1; | |
// show changed value in main process (in stdout, as a proof it was changed) | |
var ipcRenderer = require('electron').ipcRenderer; | |
ipcRenderer.send('show-prop1'); | |
// show changed value in renderer process (in dev console) | |
console.log(remote.getGlobal('sharedObj').prop1); | |
</script> | |
<script> | |
document.write('<p>zyre.name: ' + zyrename + '</p>'); | |
document.write('<p>electron.version: ' + process.versions.node + '</p>') | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment