msokk / electron-render-service

Microservice for rendering PDF/PNG/JPEG from HTML with Electron
MIT License
102 stars 31 forks source link

headless chrome #42

Open burningTyger opened 7 years ago

burningTyger commented 7 years ago

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

msokk commented 7 years ago

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

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

burningTyger commented 7 years ago

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.

msokk commented 7 years ago

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.

burningTyger commented 7 years ago

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

p3k commented 7 years ago

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?

msokk commented 7 years ago

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.

Reggino commented 6 years ago

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