{
  "slug": "script-tool-handles-dialogs-during-evaluation-f3b1921cb0b9",
  "title": "script tool handles dialogs during evaluation",
  "tools": [
    "chrome-devtools-mcp"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-21T14:25:09.000Z",
  "announced_at": "2026-04-21T14:25:09.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When evaluating a page script that opens a browser dialog, set `dialogAction` to `accept`, `dismiss`, or a response string for `window.prompt`; it defaults to `accept`.",
    "examples": [
      "evaluate_script({\"function\":\"() => { window.prompt('Enter value'); return document.title; }\",\"dialogAction\":\"<accept|dismiss|prompt response>\"})"
    ],
    "gotchas": [
      "Version: 0.22.0",
      "function (required): JavaScript function declaration to execute in the selected page; return values must be JSON-serializable.",
      "dialogAction: Dialog handling during execution: `accept`, `dismiss`, or a string response for `window.prompt`; defaults to `accept`.",
      "args: Optional list of arguments to pass to the function."
    ]
  },
  "why_it_matters": "When evaluating page scripts that trigger browser dialogs, pass a dialog action to control the dialog while the script runs.",
  "sources": [
    "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0",
    "https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1839",
    "https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/da33cb5b957fb87bbbab67e4c1521535065881f/docs/tool-reference.md"
  ],
  "rank": 0.92025,
  "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": "ghtools-20261008",
    "verdict_id": "ghtools-20261008:ghtools-20261008-6d8f42ec3741aa53-1:gate",
    "evidence_hash": "9737eb5516d75e7582529d3245b3cc72244d618ba6c416a0fe7e4cedb4581d02"
  },
  "review": {
    "draft_hash": "49c300f388bb5a91f8407815ebf3d4ad83cb0bbfac58848ad6b3297ce46387cf",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "ghtools-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.92 >= 0.9; 2 needed) and Jev gave 0.77 (>= 0.6 needed)."
  }
}
