{
  "slug": "playwright-websocket-routes-expose-requested-protocols-1094a183ce10",
  "title": "Playwright WebSocket routes expose requested protocols",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-11T19:08:18.000Z",
  "announced_at": "2026-05-11T19:08:18.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When handling a routed WebSocket, call `ws.protocols()` to inspect the subprotocols requested by the page; it returns an empty array if none were specified.",
    "examples": [
      "await page.routeWebSocket('wss://example.com/ws', ws => {\n  const requestedProtocols = ws.protocols();\n});"
    ],
    "gotchas": [
      "Version: v1.60.0",
      "webSocketRoute.protocols() (required): No arguments; returns the requested subprotocols as an array of strings, or an empty array when none were specified.",
      "page.routeWebSocket(url, handler) (required): Sets up the WebSocket route whose handler receives the WebSocketRoute; replace the example URL with the target WebSocket URL or pattern.",
      "Prerequisite: Use Playwright v1.60 or later; `WebSocketRoute.protocols()` was added in v1.60."
    ]
  },
  "why_it_matters": "Inspect the subprotocols requested by a page when handling a WebSocket route.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.60.0",
    "https://github.com/microsoft/playwright/blob/v1.60.0/docs/src/api/class-websocketroute.md",
    "https://playwright.dev/docs/api/class-websocketroute"
  ],
  "rank": 0.96016,
  "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-15228fe3d33f40e5-10:gate",
    "evidence_hash": "8d2217b180ed48f8295026249b4e63507609b51ecea3842ff24b521ee9c9c11e"
  },
  "review": {
    "draft_hash": "a1cd614cb243d2869c32889b0ee3b73d3592f13cd282fcc122db48067dbd235b",
    "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.96 >= 0.9; 2 needed) and Jev gave 0.68 (>= 0.6 needed)."
  }
}
