How to get a Puppeteer script running inside Electron

My app is done, Screenshot Generator and I’m really happy how it functions, the only slight problem is that it doesn’t work…

Screenshot Generator App Preview

I have a Generate button component from which I try to launch a puppeteer.js script (Node.js), but I just don’t know how to invoke it.

Here is what I in theory want to do sketched out. This I made before starting the project and I just started building it knowing that I didn’t know how to get this last part working. I now miss 10% off the puzzle which makes my app useless. I’m stuck at and I don’t know how to proceed.

Screenshot Generator Sketch logic

I’ve looked in to

  • Using a local version of Chrome
  • Using puppeteer-core instead of the full puppeteer
  • Node child process using fork
  • Node child process using spawn

But all this is just a bit over my head. If any of you have any pointers on how to get it working, please let me know, otherwise just close the issue.