mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Issues: #7757
This commit is contained in:
parent
8d4067e634
commit
7748730163
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user