Skip to content

fix(cli): normalize bare bracketed IPv6 addresses - #3583

Open
raunakpandey1 wants to merge 1 commit into
browserbase:mainfrom
raunakpandey1:fix/browse-ipv6-host-scheme
Open

raunakpandey1 wants to merge 1 commit into
browserbase:mainfrom
raunakpandey1:fix/browse-ipv6-host-scheme

Conversation

@raunakpandey1

@raunakpandey1 raunakpandey1 commented Nov 30, 2026 •

Copy link
Copy Markdown

why

Fixes #3582. Developers using browse open with bare IPv6 loopback addresses get a Chrome navigation error, although explicitly adding http:// reaches the same local server.

what changed

Recognize valid bracketed IPv6 addresses during URL normalization. Apply the existing scheme policy to them: HTTP for loopback, HTTPS for other hosts. Preserve the supplied address, port, path, query, and fragment. Explicitly schemed URLs and invalid bracketed inputs pass through unchanged.

test plan

  • pnpm --filter browse test:cli tests/normalize-url.test.ts: three new regression cases failed on main. All 22 cases pass with the fix.
  • Built with pnpm --filter browse build. Used browse open --local with Chrome against a Node HTTP server bound to ::1, following the issue's reproduction. On main, the explicit URL opened the fixture and the bare address exited 1 with -32000 Cannot navigate to invalid URL. With this patch, both forms exited 0 and returned the fixture's title and http://[::1]:<port>/ URL.
  • The changed TypeScript files passed the repository's oxfmt check, and git diff --check passed.

Summary by cubic

Fixes #3582: browse open now normalizes bare bracketed IPv6 addresses like [::1]:3000 so Chrome can open them without an explicit scheme. Previously these failed with Cannot navigate to invalid URL.

  • Applies the existing scheme policy: http:// for [::1] loopback, https:// for other IPv6 hosts.
  • Preserves the supplied port, path, query, and fragment; explicitly schemed URLs and invalid bracketed inputs pass through unchanged.

Written for commit 01d1f65. Summary will update on new commits.

View guided diff

@changeset-bot

changeset-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 01d1f65

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 30, 2026

This branch has not been deployed

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

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browse open rejects bracketed IPv6 addresses without a URL scheme

1 participant