Skip to content

Commit

Permalink
chore: revert #7868 to use the size parameter for streaming PDF (#8145)
Browse files Browse the repository at this point in the history
Issues: #7757
  • Loading branch information
OrKoN committed Mar 18, 2022
1 parent 8d4067e commit 7748730
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/common/helper.ts
Expand Up @@ -360,15 +360,12 @@ async function getReadableFromProtocolStream(

let eof = false;
return new Readable({
async read() {
// TODO: use the advised size parameter to read function once
// crbug.com/1290727 is resolved.
// Also, see https://github.com/puppeteer/puppeteer/pull/7868.
async read(size: number) {
if (eof) {
return null;
}

const response = await client.send('IO.read', { handle });
const response = await client.send('IO.read', { handle, size });
this.push(response.data, response.base64Encoded ? 'base64' : undefined);
if (response.eof) {
eof = true;
Expand Down

0 comments on commit 7748730

Please sign in to comment.