You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is this needed instead of just using child_process('electron', {stdio: 'pipe'}).on('data', () => {})?
I assume its because child.send wouldn't work.
From initial glance I thought you were overriding some require('electron') stuff, but the Electron class is just a wrapper.
Looks like it just overrides console in the renderer (preload.js) to send those messages to the main process (runner.js), which then sends them back to the node script via stdio: ipcprocess.send.
The text was updated successfully, but these errors were encountered:
vjpr
changed the title
Add use case / motivation to readme
Add use case / motivation / explanation to readme
May 11, 2022
This module lets you feed JS to a hidden browser, and returns the browser's console output. The difference to your example is that it doesn't execute it in the main process, but in the renderer process, where you have access to the DOM and all browser JS APIs. Does that answer your question?
Why is this needed instead of just using
child_process('electron', {stdio: 'pipe'}).on('data', () => {})
?I assume its because
child.send
wouldn't work.From initial glance I thought you were overriding some
require('electron')
stuff, but theElectron
class is just a wrapper.Looks like it just overrides
console
in the renderer (preload.js
) to send those messages to the main process (runner.js
), which then sends them back to the node script viastdio: ipc
process.send
.The text was updated successfully, but these errors were encountered: