Fetch.fulfillRequest and (very) long body

168 views
Skip to first unread message

Fabien Picarougne

unread,
May 3, 2023, 3:07:46 AM5/3/23
to chrome-debugging-protocol
Hi everyone,
I want to send via CDP a very long body to a request (for example a video file for a video html tag). Is it possible to send such a very long body message in Fetch.fulfillRequest? or can I transmit frames as stream (but I don't see any IO.write method)?
Kind regards
Fabien

Andrey Kosyakov

unread,
May 3, 2023, 6:46:36 PM5/3/23
to Fabien Picarougne, chrome-debugging-protocol
Hi Fabien,

On Wed, May 3, 2023 at 12:07 AM Fabien Picarougne <fabien.p...@gmail.com> wrote:
I want to send via CDP a very long body to a request (for example a video file for a video html tag). Is it possible to send such a very long body message in Fetch.fulfillRequest? or can I transmit frames as stream (but I don't see any IO.write method)?

Unfortunately, there's no streaming support for Fetch network interception at the moment, so all response overrides are inherently limited by whatever fits in a single CDP message.

Best regards,
Andrey.

Fabien Picarougne

unread,
May 4, 2023, 3:41:49 AM5/4/23
to chrome-debugging-protocol
Thanks for your answer.
Just a small additional question: what is the size limit of a single CDP message?

Kind regards
Fabien

Milan Hauth

unread,
Jan 24, 2024, 5:19:47 AMJan 24
to chrome-debugging-protocol
all response overrides are inherently limited by whatever fits in a single CDP message.

this seems to be limited only by RAM
i just tried to insert a 1GB response, and it only failed because of a CDP timeout
(and its terribly slow, probably because of the JSON overhead)

its surprising that such a basic feature is missing

there is Fetch.takeResponseBodyAsStream and IO.read
but not Fetch.giveResponseBodyAsStream and IO.write

there is Network.takeResponseBodyForInterceptionAsStream and IO.read
but not Network.giveResponseBodyForInterceptionAsStream and IO.write

Ilya Kreymer

unread,
May 26, 2024, 3:41:03 PMMay 26
to chrome-debugging-protocol
I was also looking for this functionality for a while, and finally opened an issue requesting streaming write support last month: https://issues.chromium.org/issues/332570739
I know its low priority, but maybe will get implemented some day if enough folks are interested in it?

Ilya
Reply all
Reply to author
Forward
0 new messages