electron-render-service icon indicating copy to clipboard operation
electron-render-service copied to clipboard

headless chrome

Open burningTyger opened this issue 7 years ago • 7 comments

Now that headless is about to appear in v59 of Chrome are you going to switch so xvfb can be dropped? It doesn't have paper size etc but that is in review afaik so v60 should be a good bet

burningTyger avatar May 02 '17 15:05 burningTyger

If I have time, but it definitely would be a new project as I would:

  • Base the docker image on Node Alpine with Chromium installed
  • Use https://github.com/cyrus-and/chrome-remote-interface/
  • Rewrite API bit in Koa v2 using async
  • Maybe just do PDF generation (haven't used image part much)

The PDF options patch should get a code review tomorrow - https://codereview.chromium.org/2829973002/#ps20001

msokk avatar May 03 '17 12:05 msokk

Why do you want the remote interface for that? Just calling the headless chrome instance will spit out the pdf and that's it. Can be served right away without any intermediate scripts.

burningTyger avatar May 03 '17 12:05 burningTyger

Should drop waitForText parameter support then (and anything else that operates with page scripting). Overall PDF generation is getting more trivial to tailor into one's microservice.

msokk avatar May 03 '17 12:05 msokk

You're right. Forgot about that. Things are getting very neat.

burningTyger avatar May 03 '17 13:05 burningTyger

I am an avid user of the waitForText option; if it would be dropped does that mean there is a replacement in headless Chrome or would it be simply gone, then?

p3k avatar May 09 '17 14:05 p3k

I would want to maintain feature parity, otherwise one could just use headless CLI directly. waitForText is doable and exactly in the same way as in Electron - https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-searchInResource Looks like we could add regexp support.

msokk avatar May 09 '17 15:05 msokk

May be inspired by https://github.com/esbenp/pdf-bot

Reggino avatar Nov 17 '17 12:11 Reggino