Electron:前端網頁傳到後端electron.js做事 Handling Click Events In The DOM

// Renderer Process
const {ipcRenderer} = require('electron')
window.onblur = function() {
console.log('blur');
ipcRenderer.send("Dosomething");
};
// Main Process
const {BrowserWindow, ipcMain} = require('electron')
ipcMain.on('Dosomething', () => { //對應正確的字串執行
console.log('done');
})

留言