feat: support any-match text arrays in wait_for#1011
Merged
OrKoN merged 7 commits intoChromeDevTools:mainfrom Feb 24, 2026
Merged
feat: support any-match text arrays in wait_for#1011OrKoN merged 7 commits intoChromeDevTools:mainfrom
OrKoN merged 7 commits intoChromeDevTools:mainfrom
Conversation
OrKoN
requested changes
Feb 23, 2026
Collaborator
|
Thanks for the PR! Mostly looks good, left a couple of comments. |
862130e to
1bb8f13
Compare
Collaborator
Lightning00Blade
left a comment
There was a problem hiding this comment.
Overall looks good with some comments.
Lightning00Blade
approved these changes
Feb 23, 2026
Collaborator
Lightning00Blade
left a comment
There was a problem hiding this comment.
Looks good. Could you rebase as there seem to be some merge conflicts.
I will wait for @OrKoN review as well before merging.
OrKoN
approved these changes
Feb 23, 2026
Collaborator
OrKoN
left a comment
There was a problem hiding this comment.
LGTM, please resolve merge conflict
Implements wait_for text as string | string[] and resolves when any candidate appears. Adds schema/tests/docs updates for ChromeDevTools#916.
Updated the description of the wait_for tool to remove unnecessary details about input types. Removed tests that validated string and array inputs for the wait_for schema, as they are no longer applicable.
9b3020c to
3c38d21
Compare
Contributor
Author
|
@OrKoN Conflicts resolved (rebased with upstream main and regenerated docs) |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 25, 2026
🤖 I have created a release *beep* *boop* --- ## [0.18.0](chrome-devtools-mcp-v0.17.3...chrome-devtools-mcp-v0.18.0) (2026-02-24) ### 🎉 Features * `--slim` mode for maximum token savings ([#958](#958)) ([c402b43](c402b43)) * add a new skill for accessibility debugging and auditing with Chrome DevTools MCP. ([#1002](#1002)) ([b0c6d04](b0c6d04)) * add experimental screencast recording tools ([#941](#941)) ([33446d4](33446d4)) * add skill to debug and optimize LCP ([#993](#993)) ([2cd9b95](2cd9b95)) * add storage-isolated browser contexts ([#991](#991)) ([59f6477](59f6477)) * add take_memory_snapshot tool ([#1023](#1023)) ([7ffdc5e](7ffdc5e)) * support any-match text arrays in wait_for ([#1011](#1011)) ([496ab1b](496ab1b)) * support type_text ([#1026](#1026)) ([b5d01b5](b5d01b5)) ### 🛠️ Fixes * detect X server display on Linux ([#1027](#1027)) ([1746ed9](1746ed9)) ### ♻️ Chores * cleanup string and structured console formatters ([#1005](#1005)) ([0d78685](0d78685)) * extract version in a seprate file ([#1032](#1032)) ([0106865](0106865)) * move emulation settings to context ([#1000](#1000)) ([bc3c40e](bc3c40e)) * optimize slim tool descriptions and params ([#1028](#1028)) ([ca6635d](ca6635d)) * simplify JavaScript code examples, update code block language, and refine descriptions in a11y debugging skill documentation. ([#1009](#1009)) ([5cedcaa](5cedcaa)) * types for JSON output of IssueFormatter ([#1007](#1007)) ([9ef4479](9ef4479)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
wolfib
pushed a commit
to wolfib/chrome-devtools-mcp
that referenced
this pull request
Mar 10, 2026
## Summary Enhances wait_for to support waiting on multiple possible texts and resolve when any one appears. This addresses long-running flows that can end in different UI outcomes (for example, "Complete" or "Error"), avoiding unnecessary 300s waits when only one expected string is provided. Closes ChromeDevTools#916. ## Tool Update ### wait_for Waits for text on the selected page, now with any-match support. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | text | string \| string[] | yes | A single text or a non-empty list of texts. Resolves when any value appears. | | timeout | integer | no | Maximum wait in ms (0 keeps default behavior). | --- ## Design / Implementation - Kept backward compatibility: existing single-string text calls continue to work unchanged. - Added schema support for string | string[] with non-empty array validation. - Updated context API to accept string | string[]. - Matching logic now normalizes to an array and races all candidates across all frames using both: - aria/<text> - text/<text> - Added clearer response output for array input: - Element matching one of ["Complete","Error"] found. - Updated generated tool docs for the new wait_for contract. - Improved docs generation to render ZodUnion types (so union params are documented correctly, not as unknown). --- ## Tests Added/updated coverage for: - Schema acceptance of: - single string - non-empty string array - rejection of empty array - Any-match array success case - Any-match array when matching text appears later (async/delayed content) - Existing wait_for behavior remains covered for single-text usage Executed relevant test suites: - tests/tools/snapshot.test.ts - tests/McpContext.test.ts - tests/index.test.ts Confirmation after the change applied: https://opncd.ai/share/8m6I4r4a
wolfib
pushed a commit
to wolfib/chrome-devtools-mcp
that referenced
this pull request
Mar 10, 2026
🤖 I have created a release *beep* *boop* --- ## [0.18.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v0.17.3...chrome-devtools-mcp-v0.18.0) (2026-02-24) ### 🎉 Features * `--slim` mode for maximum token savings ([ChromeDevTools#958](ChromeDevTools#958)) ([c402b43](ChromeDevTools@c402b43)) * add a new skill for accessibility debugging and auditing with Chrome DevTools MCP. ([ChromeDevTools#1002](ChromeDevTools#1002)) ([b0c6d04](ChromeDevTools@b0c6d04)) * add experimental screencast recording tools ([ChromeDevTools#941](ChromeDevTools#941)) ([33446d4](ChromeDevTools@33446d4)) * add skill to debug and optimize LCP ([ChromeDevTools#993](ChromeDevTools#993)) ([2cd9b95](ChromeDevTools@2cd9b95)) * add storage-isolated browser contexts ([ChromeDevTools#991](ChromeDevTools#991)) ([59f6477](ChromeDevTools@59f6477)) * add take_memory_snapshot tool ([ChromeDevTools#1023](ChromeDevTools#1023)) ([7ffdc5e](ChromeDevTools@7ffdc5e)) * support any-match text arrays in wait_for ([ChromeDevTools#1011](ChromeDevTools#1011)) ([496ab1b](ChromeDevTools@496ab1b)) * support type_text ([ChromeDevTools#1026](ChromeDevTools#1026)) ([b5d01b5](ChromeDevTools@b5d01b5)) ### 🛠️ Fixes * detect X server display on Linux ([ChromeDevTools#1027](ChromeDevTools#1027)) ([1746ed9](ChromeDevTools@1746ed9)) ### ♻️ Chores * cleanup string and structured console formatters ([ChromeDevTools#1005](ChromeDevTools#1005)) ([0d78685](ChromeDevTools@0d78685)) * extract version in a seprate file ([ChromeDevTools#1032](ChromeDevTools#1032)) ([0106865](ChromeDevTools@0106865)) * move emulation settings to context ([ChromeDevTools#1000](ChromeDevTools#1000)) ([bc3c40e](ChromeDevTools@bc3c40e)) * optimize slim tool descriptions and params ([ChromeDevTools#1028](ChromeDevTools#1028)) ([ca6635d](ChromeDevTools@ca6635d)) * simplify JavaScript code examples, update code block language, and refine descriptions in a11y debugging skill documentation. ([ChromeDevTools#1009](ChromeDevTools#1009)) ([5cedcaa](ChromeDevTools@5cedcaa)) * types for JSON output of IssueFormatter ([ChromeDevTools#1007](ChromeDevTools#1007)) ([9ef4479](ChromeDevTools@9ef4479)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances wait_for to support waiting on multiple possible texts and resolve when any one appears.
This addresses long-running flows that can end in different UI outcomes (for example, "Complete" or "Error"), avoiding unnecessary 300s waits when only one expected string is provided.
Closes #916.
Tool Update
wait_for
Waits for text on the selected page, now with any-match support.
Design / Implementation
Tests
Added/updated coverage for:
Executed relevant test suites:
Confirmation after the change applied:
https://opncd.ai/share/8m6I4r4a