Skip to content

Use pending URLs when restoring browser tabs - #346996

Merged
Kyle Cutler (kycutler) merged 1 commit into
microsoft:mainfrom
sameerihs:restore-pending-browser-urls
Nov 9, 2026
Merged

Kyle Cutler (kycutler) merged 1 commit into
microsoft:mainfrom
sameerihs:restore-pending-browser-urls

Conversation

@sameerihs

Copy link
Copy Markdown
Contributor

Fixes #346992

Reusing an unresolved restored browser tab updates its pending URL, but native creation still uses the captured saved URL. Read the current pending URL when resolving the tab.

Reuse normal navigation's scheme normalization so bare destinations such as localhost:3000/requested continue to receive http://. The helper contains the existing normalization unchanged and serves both paths.

The registered-command regression fails before the fix. A second case preserves bare-localhost behavior. Both cases and all 58 tests across six nearby files pass, along with targeted ESLint and the combined core no-emit typecheck. Validation covers the native creation request; a full restart/Chromium UI run was not performed.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 15:07
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Kyle Cutler (@kycutler)

Matched files:

  • src/vs/workbench/contrib/browserView/common/browserView.ts
  • src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts
  • src/vs/workbench/contrib/browserView/test/electron-browser/browserViewWorkbenchService.test.ts

Joaquín Ruales (@jruales)

Matched files:

  • src/vs/workbench/contrib/browserView/common/browserView.ts
  • src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts
  • src/vs/workbench/contrib/browserView/test/electron-browser/browserViewWorkbenchService.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable review issues remain, though validation did not include a full restart or Chromium UI run.

No open issues 🎉

What changed in this PR

Fixes #346992 by making unresolved restored Integrated Browser tabs use the latest pending URL when creating their native view, rather than the saved URL.

Changes:

  • Reads the current input URL during lazy restoration.
  • Shares existing URL normalization between restoration and normal navigation.
  • Adds registered-command regression tests for tab reuse and bare-localhost normalization.

No actionable findings remain. Reported validation covers native creation requests; a full restart and Chromium UI run was not performed.

File Description
src/​vs/​workbench/​contrib/​browserView/​test/​electron-browser/​browserViewWorkbenchService.test.ts Adds regression coverage for pending URLs and localhost normalization.
src/​vs/​workbench/​contrib/​browserView/​electron-browser/​browserViewWorkbenchService.ts Uses the current normalized input URL when restoring a native view.
src/​vs/​workbench/​contrib/​browserView/​common/​browserView.ts Extracts existing navigation normalization into a shared helper.

Review effort: Balanced

@kycutler Kyle Cutler (kycutler) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you Sameer (@sameerihs)!

@kycutler
Kyle Cutler (kycutler) merged commit afde15b into microsoft:main Nov 9, 2026
52 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants