Repository navigation
fix(browser): import cookies on This-device pages, into the page's own login store - #47142
Conversation
… own jar This-device pages now offer Import Cookies and the new tab import hint, filling the page's own jar (its server profile on its own network host). A page's import and profile list follow the page, not Settings › Browser's host, and Settings imports into a server's non-default profile validate it by the server's metadata.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
When a paired server's browser tab runs on this computer ("This device", the default), its ⋯ menu had no Import Cookies and its new tab page had no import button, so you couldn't sign it in. Now it has both, and the cookies go into that tab's own login store. Separately, a normal local tab's import no longer goes to a server just because Settings › Browser was showing that server.
What Changed
showProfiles={false}hid both, so the only way in was Settings › Browser with the server as host. After: the same local submenu and hint, reading this desktop's browsers. Main finds the page's live jar (its partition and server profile) through the client-page executor that created it, so a page whose network runs on an SSH host or WSL distro behind the server fills its own jar, not the server-native one that Settings imports fill.BrowserToolbarMenuand the hint called the store actions with no target, so they routed bygetBrowserSettingsHostId. Once a paired server was the Settings host (the active-server setting is enough), a local page's import wrote this desktop's cookies into that server's This-device store while the toast said it worked. Its Profile submenu also listed the server's profiles, and New Profile… created one there. After: the page passes a route (local,sshorclient-host), and its profile list and profile creation use that host.validateBrowserRouteProfile, which both paths use.pageChangedmessage, in every locale, rather than filling a different jar.Why
These are parity fixes. Local pages already import into their own jar from the ⋯ menu and the new tab page, and SSH pages were already made page-relative (#45913). Resolving the target from the page, at the layer that owns it (the executor that holds each client page's partition), covers nested execution hosts too. A Settings-level fix can't, because the server's own jar identity is the wrong store for those pages. Passing the server's profile metadata reuses the rule page creation already trusts, rather than adding a second profile registry.
Linked Issue
No issue. These are gaps M28, NEW-1, NEW-3 and NEW-11 from the remote browser parity audit. The profile switcher for these pages (#31039) follows in a separate PR.
Visual Proof
The captures come from a hidden dev build paired to a worktree-built
orca serve, on a This-device page of the server's workspace.Before, the ⋯ menu on a This-device page has no Import Cookies row:

After, Import Cookies › From Firefox / From File… on the same page:

After, the new tab page's "Import browser data" hint on a This-device page:

Testing
Real remote runtime, macOS: a worktree-built
orca servepaired to a hidden dev build, both with scratch HOMEs and the mock keychain. The scratch HOME has a fake Firefox profile, so "From Firefox" ran with no keychain prompt. I read each guest's cookies through its own CDP target (Network.getCookies).This-device page, switched to a fresh non-default server profile: the guest had no cookies, then ⋯ › Import Cookies › From Firefox, then the guest had both cookies. The new tab hint path did the same on another fresh profile. The local page's guest was untouched.
Settings host set to the server, Settings import into its non-default profile: "Session profile not found." on main, ok on the branch.
Local page while the paired server is the Settings host. On main, the Profile list showed the server's profile and the import toast said "stored here for the wrbdci-server workspace". On the branch, it lists only local profiles and the import lands in the local page's jar.
Nested SSH/WSL execution hosts behind a server were not run live (no nested target here). The page path reads the jar from the page's own executor record, so it doesn't depend on the host kind.
pnpm check:changedpasses. One review-loop round (Codex + Claude): one accepted finding, fixed. A profile switch while the picker was open could redirect the import, so the page jar is now pinned to the one the request saw.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
No tests were added. The change is routing between the renderer, IPC and main, proven by the live run above. A unit test here would only assert mock calls.
Performance
None, because the new work runs only when the ⋯ menu opens or an import starts: one in-memory map lookup, plus a profile listing fetch for the page's host the first time its list isn't loaded.
Risk
The riskiest part is that page imports no longer use the Settings host. If the page route were wrong, an import would land in the wrong jar, so each route was checked live. Settings › Browser imports keep their old routing, plus metadata for server profiles. No server RPC or wire format changes, so older servers and phones see no difference: the renderer↔main IPC args are same-build and only gained optional fields. Server (streamed) pages still hide import and profiles. A plain revert backs it out.
Level: Medium
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
SSH-routed pages keep their existing page-relative import. Folder workspaces are unaffected. Mobile is not touched.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)