November 2019
Beginner
436 pages
8h 52m
English
Let's introduce editor-event so that we can handle messages from Node.js . We need to import an ipcRenderer object from the Electron framework and listen to any channel. In this case, it is going to be editor-event. For the sake of simplicity, let's output the message's content to the browser console:
<script> const { ipcRenderer } = require('electron'); ipcRenderer.on('editor-event', (event, arg) => { console.log(arg); });</script>
The preceding code listens to the editor-event channel and writes the message to the browser console's output.
Read now
Unlock full access