etienne-martin / svg-to-img

A node.js library to convert SVGs to images built with Puppeteer.
MIT License
56 stars 22 forks source link

Connect to Puppeteer Endpoint, Update Puppeteer to 2.0.0 #19

Closed qqilihq closed 2 years ago

qqilihq commented 4 years ago

This PR adds the possibility to connect to a Browserless endpoint using browserWSEndpoint as described in #9

Open questions:

I personally would prefer to use the puppeteer-core dependency in this library (and puppeteer only within devDependecies). This way, Chromium would not automatically be pulled. People who want to use an “embedded” Chromium could still achieve this by explicitly adding puppeteer to their dependencies. However this would be a breaking change.

With the current version, for people who do not want the “embedded” Chromium, there’s the PUPPETEER_SKIP_CHROMIUM_DOWNLOAD flag (see updated readme.md) which would need to be set before running installation via npm resp. yarn.

Kudos also go to @danielesser who helped testing this!

qqilihq commented 4 years ago

@etienne-martin We're currently still investigating a potential issue with timeouts when running via WebSockets. Please wait before merging. Sorry!

qqilihq commented 4 years ago

@etienne-martin Okay, mentioned issue is fixed with previous commit (btoa required some additional treatment for encoding special chars).

qqilihq commented 4 years ago

@etienne-martin Any more feedback so far? :-)

qqilihq commented 4 years ago

@etienne-martin Are you still interested in integrating this? Else wise I’d push a forked version to NPM.

etienne-martin commented 4 years ago

Yes sorry I've been super busy lately!

qqilihq commented 4 years ago

No worries -- just wanted to double check. I’d really like to avoid having a fork on NPM, so I’ll be patient instead :-) Cheers!

qqilihq commented 4 years ago

FYI: In case anyone needs this, we made this fork available on @nodepit/svg-to-img now.