Skip to content

Instantly share code, notes, and snippets.

@imansigupta
Last active June 16, 2020 18:13
Show Gist options
  • Save imansigupta/f2c6f3730d871482477c645724e9ecea to your computer and use it in GitHub Desktop.
Save imansigupta/f2c6f3730d871482477c645724e9ecea to your computer and use it in GitHub Desktop.
const ipcRenderer = require('electron').ipcRenderer;
const btnclick = document.getElementById('activate_button');
btnclick.addEventListener('click', function() {
var arg = "secondparam";
ipcRenderer.send("btnclick", arg); // ipcRender.send will pass the information to main process
});
ipcRenderer.on('btnclick-task-finished', function(event, param) {
console.log(param)
document.getElementById("message").innerHTML += param;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment