0

I have a rendering process open a modal window

import { remote } from 'electron';

let currentWindow = remote.getCurrentWindow();
let modalWindow = new BrowserWindow({width:800, heigh:500, parent:currentWindow});
modalWindow.loadURL('views/second.html');

How can I pass a message from the modalWindow back to its parent?

Mike M
  • 4,879
  • 5
  • 38
  • 58

1 Answers1

2

You have to use ipc communication.

In the Main process:

ipcMain.on('asynchronous-message', (event, arg) => {
   //manage data
})

And in your modalWindow:

ipcRenderer.send('asynchronous-message', message)

ipcMain doc

ipcRenderer doc

emish89
  • 696
  • 8
  • 25