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

  • Electron Projects
  • Denys Vuika
  • 83字
  • 2021-06-24 12:14:38

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.

主站蜘蛛池模板: 和政县| 阜南县| 灵台县| 龙泉市| 通化市| 江山市| 黑山县| 南皮县| 新绛县| 巴彦淖尔市| 枝江市| 永和县| 迭部县| 乡宁县| 诸城市| 连南| 信宜市| 卢龙县| 上杭县| 武鸣县| 香河县| 马鞍山市| 纳雍县| 宽城| 唐海县| 龙岩市| 南通市| 云龙县| 汉沽区| 东乡县| 雅江县| 蓝田县| 南投县| 敦化市| 松溪县| 汤原县| 黄浦区| 长宁区| 金平| 吴堡县| 岚皋县|