Best way to send Object from webview with .executeJavaScript


#1

I’m trying to get an html element and its computed style from a webview (by sending quite a large string through .executeJavaScript), and need to send the objects back. I’ve tried to console.log them and use the 'console-message' event to get them back to the renderer process to then get the styling and html that I need from them. It’s not working at the moment, is there another way to send full objects or variable values from the webview (with something that can be injected with .executeJavaScript) ? Thanks.


#2

It sounds like what you need is IPC for communication between your main process and your renderer process.