Skip to content

Instantly share code, notes, and snippets.

@zoobab
Created February 8, 2016 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoobab/e53dd443935268a68334 to your computer and use it in GitHub Desktop.
Save zoobab/e53dd443935268a68334 to your computer and use it in GitHub Desktop.
<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