Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance of puppeteer #40

Open
gbtec-lukasgraessle opened this issue Apr 10, 2018 · 2 comments
Open

Instance of puppeteer #40

gbtec-lukasgraessle opened this issue Apr 10, 2018 · 2 comments

Comments

@gbtec-lukasgraessle
Copy link

Is it possible to create a way to pass not only puppeteer parameters but also an instance of puppeteer? Or maybe even just a page that is closed afterwards?

In projects where a Puppeteer instance is used, this would save resources and time in generating images.

Thank you for your help.

@Nysosis
Copy link

Nysosis commented Jul 25, 2018

I was going to raise an issue for something very related, but thought I'd mention it in this issue instead.

Puppeteer also supports connecting to a remote instance via the .connect method, and I was hoping to be able to use this method of connecting to a browser instead of launching a new one up.

However if convert-svg supported providing your own puppeteer instance, then I can .connect() myself, and provide that instance through.

@neocotic
Copy link
Owner

neocotic commented Nov 23, 2018

Sorry for the super late response but this is not currently possible but could be. However, I would ask why not simply call createConverter to get an instance of Converter that reuses the same instance of puppeteer until Converter#destroy is called. I feel like this should offer sufficient control over resource management but I'm happy to accept pull requests that expand on this.

I would also like to point out that these packages are designed to be a quick-and-dirty and the whole reason we're using puppeteer under the hood is to get first class SVG rendering without any crazy native building or porting. I'd rather not get too involved with puppeteer itself unless there's genuine use cases that the currently API does not support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants