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

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.

主站蜘蛛池模板: 宁化县| 鄄城县| 锡林浩特市| 文化| 常山县| 綦江县| 彭州市| 迁西县| 那曲县| 北碚区| 仪陇县| 陆丰市| 陕西省| 仁化县| 林口县| 绥中县| 忻州市| 三原县| 漳浦县| 金昌市| 获嘉县| 澎湖县| 梨树县| 马龙县| 阿城市| 宜都市| 隆化县| 汝南县| 灵台县| 康保县| 卫辉市| 嘉定区| 章丘市| 辉县市| 南召县| 海南省| 卢氏县| 苍溪县| 宝鸡市| 思茅市| 洱源县|