Skip to content

fix(cli): prefix scheme for bare-host URLs in browse tab new - #3577

Closed
embrace897 wants to merge 1 commit into
browserbase:mainfrom
embrace897:fix/cli-tab-new-normalize-url
Closed

embrace897 wants to merge 1 commit into
browserbase:mainfrom
embrace897:fix/cli-tab-new-normalize-url

Conversation

@embrace897

@embrace897 embrace897 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Apply normalizeUrlScheme to the optional url argument in TabNew.run (packages/cli/src/commands/tab/new.ts), matching browse open (fix(cli): prefix scheme for bare-host URLs in browse open #3512).
  • Preserve undefined when no URL is passed and keep explicit schemes (https://, about:blank, etc.) unchanged.
  • Add unit tests in packages/cli/tests/tab-new.test.ts and a patch changeset for browse.

Fixes #3574.

Testing

  • pnpm --filter browse exec vitest run tests/tab-new.test.ts tests/normalize-url.test.ts (21 passed)
  • pnpm --filter browse check (tsc --noEmit, 0 errors)
  • oxlint & oxfmt --check on changed files (0 warnings, 0 errors)

Summary by cubic

Prefixes bare-host URLs with a scheme in browse tab new, matching browse open so commands like browse tab new example.com resolve correctly. Explicit schemes (for example https:// or about:blank) and calls without a URL are left unchanged. Fixes #3574.

Written for commit f88d77d. Summary will update on new commits.

View guided diff

@changeset-bot

changeset-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f88d77d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
browse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Nov 27, 2026
@github-actions github-actions Bot added external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. and removed external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was approved by @shrey150 and mirrored to #3585. All further discussion should happen on that PR.

@github-actions github-actions Bot closed this Nov 30, 2026
shrey150 pushed a commit that referenced this pull request Nov 30, 2026
…tab new (#3585)

Mirrored from external contributor PR #3577 after approval by @shrey150.

Original author: @embrace897
Original PR: #3577
Approved source head SHA: `f88d77d8ba7d0ebe18b598ded23a928dfda8add0`

@embrace897, please continue any follow-up discussion on this mirrored
PR. When the external PR gets new commits, this same internal PR will be
marked stale until the latest external commit is approved and refreshed
here.

## Original description
## Summary
- Apply `normalizeUrlScheme` to the optional `url` argument in
`TabNew.run` (`packages/cli/src/commands/tab/new.ts`), matching `browse
open` (#3512).
- Preserve `undefined` when no URL is passed and keep explicit schemes
(`https://`, `about:blank`, etc.) unchanged.
- Add unit tests in `packages/cli/tests/tab-new.test.ts` and a patch
changeset for `browse`.

Fixes #3574.

## Testing
- `pnpm --filter browse exec vitest run tests/tab-new.test.ts
tests/normalize-url.test.ts` (21 passed)
- `pnpm --filter browse check` (`tsc --noEmit`, 0 errors)
- `oxlint` & `oxfmt --check` on changed files (0 warnings, 0 errors)


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Prefixes bare-host URLs with a scheme in `browse tab new`, matching
`browse open` so commands like `browse tab new example.com` resolve
correctly. Explicit schemes (for example `https://` or `about:blank`)
and calls without a URL are left unchanged. Fixes #3574.

<sup>Written for commit f88d77d.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/browserbase/stagehand/pull/3577?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

<!-- external-contributor-pr:owned source-pr=3577
source-sha=f88d77d8ba7d0ebe18b598ded23a928dfda8add0 claimer=shrey150 -->

Co-authored-by: embrace897 <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions Bot added external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. and removed external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The mirrored PR #3585 has been merged into main. This original external contributor PR will stay closed as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browse tab new doesn't add a scheme to bare hosts like browse open does

2 participants