Repository navigation
Conversation
…arrytan#4323) launchPersistentContext() opens a first tab of its own, and restoreState() never closed it, so every handoff window showed an untracked about:blank tab next to the restored ones. Close untracked context pages still on about:blank once the saved tabs are restored.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thank you, @Simba3696. On main at 1d3c63c, |
|
Thank you for this. We're picking up the idea. A maintainer agent working through a batch of fixes (our tracking thread GSTA-801) will first reproduce the problem on current main. If it reproduces, the agent rebuilds the fix on main with you credited as co-author, because we don't merge outside branches directly, and we'll close this PR with a link when it lands. If it no longer reproduces, we'll close this and say what changed. |
|
Thank you for the root cause and the live evidence from Windows. Your fix was rebuilt on current main and landed in #4684, with you credited as co-author: the handoff window now closes the untracked |
Why (in your own words)
Every
browse handoffwindow opens with two tabs: the page I'm meant to sign in to, and an emptyabout:blanktab next to it. On Windows I hand the window over several times a day to sign in to local apps, and the extra tab gets in the way every time (and it's easy to click into by mistake). It comes fromlaunchPersistentContext(), which opens a first tab of its own.restoreState()then opens a new page for each saved tab and never closes that first one. This change closes it at the end ofrestoreState(), but only a context page that browse doesn't track and that is still onabout:blank. Tracked tabs, and any untracked page that has navigated somewhere, are left alone.Fixes #4323
Live evidence
Real use, Windows 11, browse daemon rebuilt from this branch, then
browse stopand (the internal app's name, title and port redacted as<…>):Before the fix the headed window showed that tab plus an
about:blanktab thatbrowse tabsdoesn't list (it isn't tracked, which is also why no browse command can close it). After it, the window shows the one tab.The new test, with and without the fix, on current
main:Whole file and the type gates on this branch:
Scope
BrowserManager.restoreState()closes untrackedabout:blankpages after restoring the saved tabs (browse/src/browser-manager.ts). Adds one test case tobrowse/test/handoff.test.tsthat mirrorshandoff(): fresh tab maps plus a blank tab the context opened, thenrestoreState().recreateContext()paths beyond the existing round-trip test (anewContext()has no first tab, so the cleanup finds nothing there), or the extension andconnectheaded modes.Liveness proof (required for external contributors)
Authenticated GitHub login checked with
gh api user --jq .login:Simba3696.Checklist
GSTACK PRtyped live into a real surface) or PR author is @garrytan (owner exemption)