sindresorhus / capture-website

Capture screenshots of websites
MIT License
1.92k stars 136 forks source link

Optionally connect to running Chrome instance #32

Open soulchild opened 5 years ago

soulchild commented 5 years ago

Thanks for creating this very useful wrapper around puppeteer, Sindre!

Currently, it launches a Chrome instance for every capture via puppeteer.launch(). Would it make sense, if we added an option to let it connect to a running Chrome instance via puppeteer.connect()? I could take a look at implementing this, if there are no obvious (or not so obvious) arguments against it. 😄

stefpb commented 1 year ago

Yes, it would be nice, because puppeter.connect() is faster: https://stackoverflow.com/a/52434730/11830242

AlejandroAkbal commented 5 months ago

Yes please, I have tons of zombie processes because of this

soulchild commented 5 months ago

I decided to use the puppeteer library directly, because for my use-case this library was just a small wrapper around it anyways.

I had to deal with zombie processes as well (in a Docker/K8s environment) and the solution was to use tini as my Docker entrypoint which takes care of correctly reaping sub-process zombies.

AlejandroAkbal commented 5 months ago

Very interesting, I might have to do the same for my https://github.com/AlejandroAkbal/Screenshot-API project

Thanks for the info @soulchild 🙏