Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Connect to Puppeteer Endpoint, Update Puppeteer to 2.0.0 #19
Connect to Puppeteer Endpoint, Update Puppeteer to 2.0.0 #19
Changes from 9 commits
b7e28b1
506e133
c9d6292
f2792f8
ee0c30f
98046c2
1595365
7743c57
acca2f2
a9f9dcb
464a614
ce367c1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this portion of the doc is not up-to-date with the actual behavior.
Looking at the tests, it seams the
connect
method will throw if it can't connect to the websocket endpoint.https://github.com/etienne-martin/svg-to-img/pull/19/files#diff-4ac74674fef9fbe68755b3bdcb9fbfd4R287
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the test case was not quite accurate (connect should be outside of
try
). I updated the test code to reflect this. The readme is actually correct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why the svg string needs to be base64 encoded because of the websocket endpoint. Should it just work the same regardless if you're connected to a local Chromium instance or a remote browser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running via WebSocket I get the "Malformed SVG" error triggered in
onError
.Admittedly, I have no real clue why this only happens when running remotely (my naive assumption would probably be that the WebSocket connection breaks something with the transmitted SVG string/function?). 🤔
I've added a code comment why the encoding is necessary.