Skip to content

(feat)Normalize to pass WebSocket CDP URLs for Browser#13325

Closed
snekkenull wants to merge 5 commits intoopenclaw:mainfrom
snekkenull:(feat)Normalize-to-Pass-WS-CDP
Closed

(feat)Normalize to pass WebSocket CDP URLs for Browser#13325
snekkenull wants to merge 5 commits intoopenclaw:mainfrom
snekkenull:(feat)Normalize-to-Pass-WS-CDP

Conversation

@snekkenull
Copy link
Copy Markdown

@snekkenull snekkenull commented Feb 10, 2026

Add support for remote browser CDP which using WS protocol by normalize ws/wss → http/https so callers can pass WebSocket CDP URLs.

Greptile Summary

This PR enables users to pass WebSocket CDP URLs (ws://, wss://) as browser configuration, automatically normalizing them to HTTP/HTTPS for REST endpoint access. The normalization converts ws:http: and wss:https: in two locations: parseHttpUrl() in src/browser/config.ts:96-106 and parseBaseUrl() in src/browser/extension-relay.ts:117-138.

Changes:

  • Updated parseHttpUrl() and parseBaseUrl() to accept and normalize WebSocket protocols
  • Added comprehensive test coverage for ws/wss URL normalization
  • Updated error messages to reflect that ws(s) protocols are now accepted
  • Changed test fixture from ws:// to ftp:// for unsupported protocol validation

The approach aligns with existing normalization patterns in the codebase (see normalizeCdpHttpBaseForJsonEndpoints in src/browser/pw-session.ts:529-549).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is clean, follows existing patterns in the codebase, includes comprehensive test coverage for both ws and wss protocols, and correctly updates error messages. The normalization approach is consistent with similar logic already present in pw-session.ts.
  • No files require special attention

Last reviewed commit: 3ce0867

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

@snekkenull snekkenull changed the title (feat)Normalize to pass WebSocket CDP URLs (feat)Normalize to pass WebSocket CDP URLs for Browser Feb 10, 2026
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 21, 2026
@openclaw-barnacle openclaw-barnacle bot added size: XS and removed stale Marked as stale due to inactivity labels Feb 21, 2026
@snekkenull snekkenull closed this Feb 22, 2026
@snekkenull snekkenull reopened this Feb 22, 2026
@snekkenull snekkenull closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant