Skip to content

Feat/websocket capture#199

Open
sfc-gh-adsaxena wants to merge 7 commits intoszymdzum:mainfrom
Snowflake-Labs:feat/websocket-capture
Open

Feat/websocket capture#199
sfc-gh-adsaxena wants to merge 7 commits intoszymdzum:mainfrom
Snowflake-Labs:feat/websocket-capture

Conversation

@sfc-gh-adsaxena
Copy link

Added websocket connection and frame capture capabilities to bdg with flexible Chrome connection support.

Key Features

  • New command: bdg network websockets for viewing WebSocket connections and frames
  • Dual capture modes:
    • CDP-based capture for managed Chrome (native)
    • JavaScript fallback for external/remote Chrome
  • Multi-port support: Auto-detection for Chrome debugging ports (9222, 9223, 9224, 9333)
  • Protocol decoding:
    • Jupyter protocol message parsing with pretty-printed JSON
    • Binary frame decoding with UTF-8 text extraction
  • Remote Chrome support: Works with --chrome-ws-url flag for external browsers
  • Port-agnostic configuration: CHROME_DEBUG_PORT environment variable

sfc-gh-mochen and others added 7 commits December 23, 2025 18:20
- Remove session.json file write on stop
- Remove offline session fallback from network commands
- Delete unused output.ts module
- Update skill to discourage premature stop calls
- Remove 'save output' references from UI messages
- Demote 'bdg stop' in command listings (show peek/tail first)
- Update golden workflow test to use peek instead of session.json
- Users should use bdg peek to inspect telemetry data
# Conflicts:
#	package-lock.json
Add Playwright-style pseudo-selectors:
- :has-text("text") - element contains text (case-insensitive)
- :text("text") - smallest element with exact text
- :text-is("text") - exact text match (case-sensitive)
- :visible - element is visible

Remove nodeId caching layer:
- Delete DomElementResolver and QueryCacheManager
- Remove index-based operations (bdg dom click 0)
- Always use selectors with optional --index flag

Bug fixes:
- Fix "Object reference chain is too long" in bdg dom eval by handling
  non-serializable DOM elements gracefully
- Fix script execution errors by embedding QUERY_ELEMENTS_HELPER inside
  each IIFE instead of concatenating before it
- Update "Next steps" to show --index when multiple matches found
- Add Playwright Selectors section with :has-text, :text, :text-is, :visible
- Explain why Playwright selectors replace 2-step query+index workflow
- Update Form Interaction to show selector-based approach with --index
- Document that dom eval now handles DOM elements gracefully
- Remove references to index-based operations (bdg dom fill 0)
- Add 'Click Button by Text' pattern example
- Add --chrome-ws-url option to screenshot command for direct CDP
  connection without daemon
- Add top-level `bdg screenshot` alias for `dom screenshot`
- Create directMode module for one-shot CDP commands
  multi-port Chrome support

  - New 'bdg network websockets' command for viewing
  connections/frames
  - CDP-based capture for managed Chrome with JS fallback
  for external Chrome
  - Auto-detection for Chrome debugging ports (9222, 9223,
  9224, 9333)
  - Jupyter protocol message decoding with pretty-printed
  JSON
  - Binary frame decoding with UTF-8 text extraction
  - Remote Chrome support via --chrome-ws-url flag
  - Comprehensive documentation for 4 Chrome connection
  modes
  - Port-agnostic configuration with CHROME_DEBUG_PORT env
  var
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.

2 participants