fix: prevent Chrome auto-launch when iOS provider is active#1222
Open
jin-2-kakaoent wants to merge 3 commits intovercel-labs:mainfrom
Open
fix: prevent Chrome auto-launch when iOS provider is active#1222jin-2-kakaoent wants to merge 3 commits intovercel-labs:mainfrom
jin-2-kakaoent wants to merge 3 commits intovercel-labs:mainfrom
Conversation
…abs#1221) When using `-p ios`, Chrome was silently auto-launched alongside the iOS Safari WebDriver backend, routing all commands through Chrome instead of the intended iOS Safari session. - Skip auto-launch when `webdriver_backend` is already active - Add WebDriver polling path to `handle_wait` via unified `poll_until_true` router - Extract shared JS expression builders (`selector_check_js`, etc.) for CDP/WebDriver - Pass `--device` flag through to daemon launch command - Add `resolve_ios_device_name`/`resolve_ios_device_udid` with env var fallback - Fix WebDriver `execute/sync` requiring explicit `return` in poll expressions - Improve `loadState` error message for WebDriver backends Closes vercel-labs#1221
Contributor
|
@hyunjinee is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
After handle_wait was refactored to use the unified poll_until_true router, wait_for_text became the only wait helper with no remaining callers. The other helpers (wait_for_selector, wait_for_url, wait_for_function) are still used by dedicated handle_waitfor* handlers.
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
Fixes #1221
When using
-p ios, Chrome was silently auto-launched alongside the iOS Safari WebDriver backend. All commands (navigate, click, eval, wait) were routed through Chrome instead of iOS Safari, creating a parity gap where the agent couldn't interact with the real iOS page.Root causes and fixes:
needs_launchcheck inexecute_commandonly looked atstate.browser(CDP), ignoringstate.webdriver_backend. Now checksstate.webdriver_backend.is_none()before triggering auto-launch.handle_waitCDP-only: All wait variants (selector, text, url, function) failed with "Browser not launched" on WebDriver backends. Unified viapoll_until_truerouter that dispatches tocdp_poll_until_trueorwebdriver_poll_until_truebased on active backend.--deviceflag not forwarded: Launch command JSON didn't includedeviceName, solaunch_ioscouldn't read the user's device selection. Now passed through inmain.rswith env var fallback viaresolve_ios_device_name.returnmissing: W3C WebDriver/execute/synctreats scripts as function bodies requiring explicitreturn. Polling expressions now wrapped withreturn.selector_check_js,text_check_js,url_check_js,function_check_jsas shared pure functions used by both CDP and WebDriver paths.Test plan
test_webdriver_backend_skips_auto_launch— verifies Chrome is not auto-launched when WebDriver backend is activetest_webdriver_wait_timeout_without_cdp— timeout wait works without CDP browsertest_webdriver_wait_selector_without_cdp— selector wait uses WebDriver polling pathtest_resolve_ios_device_name_env_fallback— env var fallback for device nametest_resolve_ios_device_name_cmd_takes_priority— cmd JSON takes priority over env var