Commit graph

5 commits

Author SHA1 Message Date
Chengzhong Wu
5a14ea62b9
inspector: add protocol methods retrieving sent/received data
Add protocol method `Network.dataSent` to buffer request data. And
expose protocol methods `Network.getRequestPostData` and
`Network.getResponseBody` allowing devtool to retrieve buffered data.

PR-URL: https://github.com/nodejs/node/pull/58645
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
2025-06-20 10:20:37 +00:00
Shima Ryuhei
a4c7c9f6d7
inspector: add mimeType and charset support to Network.Response
Refs: https://github.com/nodejs/node/issues/53946
PR-URL: https://github.com/nodejs/node/pull/58192
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-05-28 10:15:37 +00:00
Chengzhong Wu
b18153598b inspector: add Network.Initiator in inspector protocol
Add initiator stack trace in inspector network events, reflecting
the location where the script created the request.

The `http.client.request.created` event is closer to where user code
creates the http request, and correctly reflects which script
initiated the request.

PR-URL: https://github.com/nodejs/node/pull/56805
Refs: https://github.com/nodejs/node/issues/53946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-08 13:39:19 +00:00
Chengzhong Wu
4f45acef19
inspector: add undici http tracking support
Add basic undici http tracking support via inspector protocol. This
allows tracking `fetch` calls with an inspector.

PR-URL: https://github.com/nodejs/node/pull/56488
Refs: https://github.com/nodejs/node/issues/53946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-01-08 16:56:42 +00:00
Chengzhong Wu
9400eae52e
inspector: report loadingFinished until the response data is consumed
The `Network.loadingFinished` should be deferred until the response is
complete and the data is fully consumed. Also, report correct request
url with the specified port by retrieving the host from the request
headers.

PR-URL: https://github.com/nodejs/node/pull/56372
Refs: https://github.com/nodejs/node/issues/53946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2025-01-05 11:43:44 +00:00