Open tmcw opened 1 year ago
We actually had an attempt like this in the past, where @lucacasonato implemented a working prototype in: https://github.com/denoland/deno/pull/11660
One problem we faced was that we were consuming memory like crazy (because all the response bodies and WS messages were being stashed for inspection), but maybe it's not a huge deal when running with --inspect
flag. That code is not really usable anymore, but it could certainly be revived. Maybe the architecture be much cleaner now that we have extension!
macro. All that said, I'd love this feature and was supposed to finish it two years ago, but my bandwidth is extremely limited right now.
This protocol (the V8 inspector protocol) is extensible and there is a version of it which includes the ability to intercept, record, and rewrite Fetch requests:
https://github.com/ChromeDevTools/devtools-protocol/blob/322248d8ad7c322817fd2557191454cc4a9b3a1e/json/browser_protocol.json#L22194
Over in the land of Node, there was a discussion of supporting this protocol, but it got closed because of staleness: https://github.com/nodejs/diagnostics/issues/75
It'd be pretty nice to be able to debug network traffic with the debugger, and it'd also make the experience of using Deno another step closer to that of other "web javascript" environments like Chrome!