{
  "slug": "playwright-browser-bind-lets-cli-and-other-clients-connect-to-a-launched-browser-6c03d7bb9873",
  "title": "Playwright browser.bind() lets CLI and other clients connect to a launched browser",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-01T00:27:06.000Z",
  "announced_at": "2026-04-01T00:27:06.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When inspecting a launched browser session, bind it with a name, then attach a client using that name or the returned endpoint. Use `host` and `port` to bind over WebSocket; call `browser.unbind()` to stop accepting connections.",
    "examples": [
      "const { endpoint } = await browser.bind('my-session', { workspaceDir: '<project-dir>' });\n// In another terminal:\nplaywright-cli attach my-session\nplaywright-cli -s=my-session snapshot",
      "const { endpoint } = await browser.bind('my-session', { host: 'localhost', port: 0 });\nconst client = await chromium.connect(endpoint);",
      "@playwright/mcp --endpoint=my-session"
    ],
    "gotchas": [
      "Version: v1.59.0",
      "title (required): Browser server name used for identification.",
      "workspaceDir: Working directory associated with the browser server.",
      "host: When specified, creates a WebSocket server instead of a named pipe.",
      "port: WebSocket port; `0` lets the OS choose an available port.",
      "endpoint (required): WebSocket endpoint string passed to `chromium.connect(endpoint)`.",
      "browser.unbind(): Unbinds the browser server previously bound with `browser.bind()`.",
      "Prerequisite: `browser.bind()` and `browser.unbind()` were added in Playwright v1.59.",
      "Prerequisite: The connecting Playwright instance’s major and minor versions must match the version that launched the browser.",
      "Multiple clients at a time are supported.",
      "Binding over WebSocket uses `host` and `port` options instead of a named pipe."
    ]
  },
  "why_it_matters": "When debugging or inspecting a repository's browser session from a coding agent, bind the launched browser and connect a client to it.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.59.0",
    "https://playwright.dev/docs/api/class-browser",
    "https://playwright.dev/docs/api/class-browsertype"
  ],
  "rank": 0.98051,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-c895c80e51052b9f-1:gate",
    "evidence_hash": "30b837f8ffc622b81590dae29ec5e3dfaebcd07c790a4f14dc0a6b78c001ee6a"
  },
  "review": {
    "draft_hash": "5eb509d71360dbf27e33eb11754b3e48db6059c25778c77c8f8f037e1f905cda",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.72 (>= 0.6 needed)."
  }
}
