Skip to content

feat(ext/node): make Network.* CDP events fire under plain --inspect - #34270

Merged
bartlomieju merged 1 commit into
denoland:mainfrom
bartlomieju:feat/inspector-network-bridge-ws-frames
May 20, 2026
Merged

bartlomieju merged 1 commit into
denoland:mainfrom
bartlomieju:feat/inspector-network-bridge-ws-frames

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Network.* CDP events for fetch and WebSocket only fired when user code
imported node:inspector — the bridge that ext/fetch and ext/websocket
look up on internals.__inspectorNetwork was installed inside that
polyfill's module body. Attaching Chrome DevTools to a script that
didn't import node:inspector showed nothing in the Network tab.

Moves the bridge install into a small always-loaded script that runs at
runtime startup via the node:process bootstrap. Also wires the missing
WebSocket frame events (frameSent / frameReceived / frameError) and
instruments Deno.upgradeWebSocket so server-side sockets accepted via
Deno.serve show up alongside their clients in the inspector.

Hoists the bridge install out of the node:inspector polyfill so
ext/fetch (and the other Network.* emitters) work under plain
--inspect without requiring `import "node:inspector"` in user code.
Also wires WebSocket frame events and instruments
Deno.upgradeWebSocket so server-accepted sockets show up too.
@bartlomieju
bartlomieju merged commit 280a349 into denoland:main May 20, 2026
266 of 270 checks passed
littledivy pushed a commit to crowlKats/deno that referenced this pull request Jun 10, 2026
…enoland#34270)

Network.* CDP events for fetch and WebSocket only fired when user code
imported node:inspector — the bridge that ext/fetch and ext/websocket
look up on internals.__inspectorNetwork was installed inside that
polyfill's module body. Attaching Chrome DevTools to a script that
didn't import node:inspector showed nothing in the Network tab.

Moves the bridge install into a small always-loaded script that runs at
runtime startup via the node:process bootstrap. Also wires the missing
WebSocket frame events (frameSent / frameReceived / frameError) and
instruments Deno.upgradeWebSocket so server-side sockets accepted via
Deno.serve show up alongside their clients in the inspector.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant