You will need to use the Electron ipcRenderer module. Regardless of the Javascript framework you are using the communication between the Chromiun browser and the Node in Electron is done by sending message to the processes.
So what happens is this:
Voce has Chromiun which is a browser and has Node which is the backend of an Electron application. If you want to take a browser information and manipulate in your main.js of Electron you need to use ipcRenderer.
Let me show you an example, buddy:
Imagine that I have a form and a button and want to get the name of the file selected by an input of type file. See below how I would have to do in the application view HTML:
<script>
const electron = require('electron');
const {ipcRenderer} = electron;
document.querySelector('form').addEventListener('submit', (event) => {
event.preventDefault();
const {path} = document.querySelector('input').files[0];
ipcRenderer.send('obterNomeArquivo', path);
});
</script>
See that the first method parameter .send ipcRenderer module is the name of your message identifier. In your main.js you can take the information as follows:
const {ipcMain} = electron;
ipcMain.on('obterNomeArquivo', (event, path)=> {
console.log(path)
});
I hope I have helped you, friend! Anything just communicate! To finish, you can see the documentation of ipcRenderer, here:
https://www.electronjs.org/docs/api/ipc-renderer
Add your code with a verifiable example of the problem so that the behavior can be reproduced.
– Leandro Angelo
I don’t have time to post an answer, but if you know English, read this excerpt from the Electron manual.
– bfavaretto