I’m writing a journal app (trying to). Having got data from the db and displaying it, I’m now trying to add edit functionality so I’ve set up an edit.html file. From a ‘edit’ button on my main index.html I use an event listener to send the record’s id to the main process. In that ipcMain.on function I want to send that data to a newly loaded html file and have that file use the data. Using ipc I can send a message back to the calling event but that is now out of scope since I’m using mainWindow.loadFile(’./edit.html’) which has its own renderer. Getting confused here. Please can someone give me a steer on how this might be achieved?
In other words, if one loads an html file, what’s the best way to give its renderer some data?