[fix]: attach to manually-created new tabs
Merged
SE
8mo ago+81+81+01234567890123456789-4-4-0123456789
why
- when a user created a new tab by clicking the "+" icon in a headful chromium browser, stagehand would not attach to it, because it filtered out the
"chrome://newtab"url pattern
what changed
- extended the conditional in
isNonWebTarget()to allow for"chrome://newtab"URLs to pass through, so that stagehand can attach to them
test plan
- added a test which creates a newtab target, & confirms that a new page object gets created
Summary by cubic
Fixes @browserbasehq/stagehand not attaching to tabs opened via the "+" button in Chromium by tracking chrome://newtab/ page targets so a page is created and becomes usable after navigation.
- Bug Fixes
- Updated
isNonWebTarget()to always track top-levelpagetargets, even with non-web schemes likechrome://newtab/. - Added Playwright tests to verify
chrome://newtab/tabs appear inpages()and work after navigating to a web URL.
- Updated