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

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.

主站蜘蛛池模板: 霍邱县| 土默特右旗| 新丰县| 永州市| 南溪县| 宁德市| 灌云县| 晋城| 平果县| 佳木斯市| 忻州市| 安义县| 景宁| 青阳县| 木兰县| 黄山市| 盖州市| 新干县| 金堂县| 金堂县| 西安市| 泉州市| 临洮县| 东乌珠穆沁旗| 怀来县| 绍兴县| 辛集市| 洛阳市| 隆昌县| 黄龙县| 临漳县| 厦门市| 临桂县| 曲水县| 张家川| 通渭县| 呼图壁县| 柳河县| 邹平县| 石渠县| 昌吉市|