官术网_书友最值得收藏!

Introducing editor-event

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.

主站蜘蛛池模板: 崇左市| 星子县| 闵行区| 枣强县| 长岭县| 久治县| 黄梅县| 海阳市| 英吉沙县| 牟定县| 九江县| 牟定县| 车致| 兴安县| 平阳县| 息烽县| 蕉岭县| 安陆市| 泌阳县| 张家口市| 蛟河市| 天峨县| 新平| 崇左市| 息烽县| 河池市| 峨眉山市| 三江| 芜湖县| 天峨县| 宾阳县| 玉龙| 澄江县| 镇平县| 辰溪县| 三台县| 广元市| 嵊州市| 大连市| 黎川县| 西乌珠穆沁旗|