Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save juliandescottes/e99e507fecf16e29fb6387025dd28363 to your computer and use it in GitHub Desktop.

Select an option

Save juliandescottes/e99e507fecf16e29fb6387025dd28363 to your computer and use it in GitHub Desktop.

Gap Analysis: Replacing DevTools RDP with WebDriver BiDi in vscode-firefox-debug

Context

The VS Code Firefox debug extension (https://github.com/firefox-devtools/vscode-firefox-debug) currently uses Firefox's proprietary Remote Debugging Protocol (RDP) over a raw TCP socket. This analysis assesses whether WebDriver BiDi (specifically the moz:debugging module) could replace it.

Already covered by BiDi

Feature How
Line/column breakpoints (set/remove) moz:debugging.setBreakpoint / removeBreakpoint
Stepping (into/over/out/resume) moz:debugging.stepInto/stepOver/stepOut/resume
Paused event with call frames + scope chain moz:debugging.paused event
JS evaluation in paused frame script.evaluate / script.callFunction (auto-targets paused frame)
Object inspection with stable handles BiDi remote object references (serialized objects have unique IDs)
Script source retrieval moz:debugging.getScriptSource
Script enumeration moz:debugging.listScripts
Console output monitoring log.entryAdded event

Remaining gaps

High priority (core debugger UX)

  • Conditional breakpointsmoz:debugging.setBreakpoint has no condition parameter. Agreed to add; not yet implemented.
  • Logpoints — No native BiDi equivalent. RDP supports type: 'logMessage' on breakpoints.

Medium priority (commonly used features)

  • Breakable locations query — RDP source actors advertise exact breakable line/column offsets, which the extension uses for reliable inline breakpoint placement. No BiDi equivalent.
  • Blackboxing / skip files — No BiDi equivalent for blackbox/unblackbox on sources.

Lower priority (specialized features)

  • Data breakpoints / watchpoints — No BiDi equivalent for observing property mutation (get/set). RDP exposes this via object actor addWatchpoint/removeWatchpoint.
  • Web Worker debugging — Unclear whether moz:debugging scope covers worker globals.
  • WebExtension debugging — Addon/extension page targeting not in BiDi.
  • Event breakpoints — No BiDi equivalent for breaking on DOM/XHR/timer events.

Implementation notes

  • Transport: The extension uses a raw TCP socket; BiDi uses WebSocket. Not a capability gap but requires rewriting the connection layer.
  • Known conflict: moz:debugging uses jsInspector.enterNestedEventLoop(), which conflicts with the DevTools debugger running simultaneously (bug 2041335). Needs resolution before both can coexist.
  • A full replacement would use multiple BiDi modules together: moz:debugging for stepping, script.* for evaluation, log.* for console — not a single drop-in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment