@roxybrowser/playwright 2.0.2-beta.5 → 2.0.2-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53408,11 +53408,34 @@ var RoxyBrowserType = class {
53408
53408
  protocol: options.protocol ?? (this.browserName === "firefox" ? "bidi" : "cdp")
53409
53409
  });
53410
53410
  }
53411
- async connect(options) {
53411
+ /**
53412
+ * Connect to an already-running browser over a WebSocket endpoint.
53413
+ *
53414
+ * ⚠️ DIVERGENCE FROM PLAYWRIGHT — DO NOT "FIX" THIS BACK TO CDP-ONLY:
53415
+ *
53416
+ * In upstream Playwright, `BrowserType.connect()` is a CDP-only operation: it
53417
+ * connects to a running Chromium over the DevTools Protocol. Firefox/WebKit are
53418
+ * not supported here (Playwright routes BiDi through `connectOverCDP`-style
53419
+ * helpers or its own internal plumbing, not this method).
53420
+ *
53421
+ * Roxy intentionally changes that semantics. This method dispatches on
53422
+ * `browserName` so a single entry point serves both browser families:
53423
+ * - chromium → CDP (ws:// DevTools endpoint)
53424
+ * - firefox → BiDi (ws:// WebDriver BiDi endpoint)
53425
+ *
53426
+ * This is deliberate, not a bug. If you are an agent "normalizing" this code to
53427
+ * match Playwright upstream, STOP — the dual-protocol dispatch is the feature.
53428
+ * To force CDP specifically, call `connectOverCDP()` instead, which remains
53429
+ * chromium-only and CDP-only by design (see the guard below).
53430
+ *
53431
+ * `options.protocol` may still be passed to override the per-browser default.
53432
+ */
53433
+ async connect(endpointURL, options) {
53412
53434
  return this.connectBrowser({
53413
- ...options,
53414
- browserName: options.browserName ?? this.browserName,
53415
- protocol: options.protocol ?? (this.browserName === "firefox" ? "bidi" : "cdp")
53435
+ browserName: this.browserName,
53436
+ protocol: this.browserName === "chromium" ? "cdp" : "bidi",
53437
+ wsEndpoint: endpointURL,
53438
+ ...options
53416
53439
  });
53417
53440
  }
53418
53441
  async connectOverCDP(progressOrEndpointURL, endpointURLOrOptions, maybeOptions = {}) {