Back to browse
JavaScript runtime instrumentation via Chrome DevTools Protocol

JavaScript runtime instrumentation via Chrome DevTools Protocol

by fcavallarin·Apr 7, 2026·2 points·0 comments

AI Analysis

●●SolidWizardryBig Brain

CDP debugger primitives enable function hooks without monkeypatching the runtime.

Strengths
  • Debugger-level control avoids modifying application source code
  • Runtime.queryObject finds live objects in heap memory
  • Conditional stepping automates async execution flow tracing
Weaknesses
  • Return value overrides only work for synchronous functions
  • No packaged tool, just techniques and writeups
Target Audience

Security researchers and JavaScript reverse engineers

Similar To

Chrome DevTools · Frida · Reversing.js

Post Description

Hi HN,

A few months ago I shared BDHS (Breakpoint-Driven Heap Search), an experiment to trace when a value appears in memory by taking heap snapshots at every debugger pause.

Since then, I’ve been experimenting further with Chrome DevTools Protocol primitives to build tools for reversing and debugging JavaScript at runtime.

Here’s the next step.

The focus is shifting from observation to instrumentation: instead of just inspecting state, the goal is to interact with execution - at specific points, in user-land code, without modifying the application.

Early experiments include:

- attaching hooks to functions at runtime - inspecting and modifying arguments and variables - overriding return values (unfortunately limited to sync functions due to CDP constraints) - following a return value to its consumer (best-effort/heuristic) - conditional stepIn/ stepOut / stepOver

All implemented via CDP (debugger breakpoints + runtime evaluation), without monkeypatching or rewriting code.

Whitepaper: https://fcavallarin.github.io/wirebrowser/CDP-as-a-Runtime-I... API docs (early): https://fcavallarin.github.io/wirebrowser/api/

I’d really appreciate feedback - especially from people doing reverse engineering, bug bounty, or complex frontend debugging.

Similar Projects