screenshot-nodejs icon indicating copy to clipboard operation
screenshot-nodejs copied to clipboard

[long term] Use Chrome headless API directly, get rid of Puppetteer

Open VojtechVitek opened this issue 7 years ago • 3 comments

This would allow us to get rid of the Node.js server wrapper. And we could write the whole service in Go only, effectively reimplement the Puppetteer.

Pros:

  • HTTP throttling would be super easy
  • Managing Headless processes would be much easier too, ie we could spin up a pool of Headless "workers" in the server, and throttle incoming requests to each available worker.
  • Zero overhead
  • HTTP/2 for free, potentially generate a GRPC client for many languages

Chrome DevTools Protocol

  • https://github.com/raff/godet
  • https://github.com/knq/chromedp

I'll look into feasibility of this option.

VojtechVitek avatar Dec 18 '17 16:12 VojtechVitek

@MarcelRusu crazy idea :)

But especially with GRPC, we could write a "Puppetteer" server with a client that works in any type of language :)

VojtechVitek avatar Dec 18 '17 16:12 VojtechVitek

Yea sounds like a lot of work :) but keep me up to date on this, sounds interesting

marcellerusu avatar Dec 18 '17 16:12 marcellerusu

docker run -it -p 9222:9222 --rm --name chrome-headless knqz/chrome-headless -window-size=1920,1080

VojtechVitek avatar Dec 21 '17 16:12 VojtechVitek