{"id":"1aef3eb9-6797-41f4-a1ee-02878a039e26","task":"Connect Playwright to a cloud browser pool (Browserless or Browserbase) via WebSocket","domain":"docs.browserless.io","steps":["For Browserless, connect with playwright.chromium.connectOverCDP('wss://<browserless-host>/chromium?token=<your-token>') to attach to a managed Chromium instance over the Chrome DevTools Protocol","For Playwright-native features (page.route(), non-Chromium browsers), use playwright.chromium.connect('wss://<browserless-host>/playwright/chromium?token=<your-token>') instead of connectOverCDP","For Browserbase, create a session first via their Sessions API (POST request returning a session object), then connect using the connectUrl from the session response","After connecting, use the resulting browser object exactly as a locally launched browser: create contexts, open pages, and run assertions normally","Implement retry logic around the connect call because cloud browser pools can return a 429 or timeout if all slots are busy; use exponential backoff with a configurable max-retry count"],"gotchas":["connectOverCDP() gives raw CDP access but loses Playwright-native features like page.route() and non-Chromium support — prefer connect() unless you specifically need CDP events","Cloud sessions have a maximum duration and idle timeout; ensure your automation completes or sends keep-alive activity before the session is forcibly closed","Do not hardcode tokens in source; read them from environment variables and never log the WebSocket URL, as it contains the credential"],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:19.328Z"},"url":"https://mcp.waymark.network/r/1aef3eb9-6797-41f4-a1ee-02878a039e26"}