Can anyone explain to me how to get js variable in html into main.js before quit


Hi so i am on my way to learn electron and its just awesome.
anyway i got a simple case here for example i have main.js who call index.html same as the tutorial electron tell.
in my index.html

<div id='data' class='container'>

and on my main.js i tell app to listen on “before quit” event and i want to get a log every #data > div text on the index.html element before quit.

app.on('before-quit', function(e) {
   #console log the One, Two, Three?


How to achieve that Thanks :slight_smile:


You can communicate between the main process and the renderer with the main process ipc and renderer ipc modules.


Thank you will look into it.