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;
|
let eof = false;
|
||||||
return new Readable({
|
return new Readable({
|
||||||
async read() {
|
async read(size: number) {
|
||||||
// TODO: use the advised size parameter to read function once
|
|
||||||
// crbug.com/1290727 is resolved.
|
|
||||||
// Also, see https://github.com/puppeteer/puppeteer/pull/7868.
|
|
||||||
if (eof) {
|
if (eof) {
|
||||||
return null;
|
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);
|
this.push(response.data, response.base64Encoded ? 'base64' : undefined);
|
||||||
if (response.eof) {
|
if (response.eof) {
|
||||||
eof = true;
|
eof = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user