Repository navigation
feat(browser): import a cookie file from Settings > Browser - #415
Merged
Merged
Conversation
# Conflicts: # apps/desktop/src/plugin_host/native/browser.rs # apps/desktop/src/surfaces/browser/mod.rs
…em off the UI thread (READER-12 #415)
|
PR test build retired — merged into |
Hona
added a commit
that referenced
this pull request
Nov 21, 2026
… pane (#550) * feat(browser): import a cookie file from Settings > Browser * fix(browser): validate cookie hosts, batch file imports, and parse them off the UI thread (READER-12 #415) * feat(browser): offer sign-ins and history from another browser on the pane, as official's SignInOffer * fix(browser): the sign-in bar shows only over a page with an address; the new tab page has the card * fix(browser): list other browsers off the UI thread so the pane's sign-in offer never stalls a draw * fix(browser): keep the browsers' listing beside the icons so surfaces/browser/mod.rs stays under 800 lines
Member
Author
Hona
added a commit
that referenced
this pull request
Nov 21, 2026
…og (#611) * feat(browser): import a cookie file from Settings > Browser * fix(browser): validate cookie hosts, batch file imports, and parse them off the UI thread (READER-12 #415) * feat(browser): offer sign-ins and history from another browser on the pane, as official's SignInOffer * fix(browser): the sign-in bar shows only over a page with an address; the new tab page has the card * fix(browser): list other browsers off the UI thread so the pane's sign-in offer never stalls a draw * feat(plugins): ui.checkbox, Desktop's compact checkbox with its label (contract 1.7) * feat(browser): Sign-ins and Browsing history boxes in the import dialog, as official's * fix(browser): keep the browsers' listing beside the icons so surfaces/browser/mod.rs stays under 800 lines * fix(browser): history comes only after sign-ins that did not fail, and never fails an import (official main.ts:285-296) * fix(browser): the import dialog takes official's frame: header with its close button, body 16 in, footer buttons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds "Import cookie file" to Settings > Browser > Advanced, using WS-1's #286 cookie store. It matches official
anomalyco/opencodeatb9a60d9d078d87bfb90f039e431090508f88ac02.Official reference (
b9a60d9d078d87bfb90f039e431090508f88ac02)settings.tsx:230-255:settings.import.file.titleand descriptionsettings.import.file.description.Choose filebutton that shows busy while the import runs.settings.tsx:56-61: titledsettings.import.file.pickand limited totxtandjsonfiles.profile/index.ts:503-516(importFile): files over 32 MiB are refused; a file that cannot be read givesread; a file that does not parse givesformat.jobs.ts:186-276:signins.failed.read.file,signins.failed.format,signins.failed.storage.signins.imported.incomplete(count plus the number skipped).signins.imported(count).settings.failed.import.jobs-machine.ts:87: the import fails after 60 s without an answer.Changes
apps/desktop/src/surfaces/browser/cookie_import.rs(new):read_cookie_filereads and checks the file: regular files only, at most 32 MiB, Netscapecookies.txt, Chrome JSON or Playwright storage state. feat(browser): enable real OS cookie encryption, CefCookieManager, remote cookie mirror, and Rust cookie importer #286 owns the parser.BrowserHost::import_profile_cookiesonce the engine's cookie store is up.pump_cookie_importdrainstake_profile_events).Browser:ImportCookieFileAsync(title): only the built-in browser plugin can call it. MCP tools and other plugins getbrowser.cookies.denied.Not in this PR
persistent, which fails asstorage). feat(browser): enable real OS cookie encryption, CefCookieManager, remote cookie mirror, and Rust cookie importer #286 has the probe for this (probe_profile_cookies); wiring it is a follow-up.Round 2 (READER-12 read 3,
notes/review-rd294.md#415 items 1-5): head 3bc4a37valid_cookie_hostaccepts only a plain hostname (alphanumerics,-,_; labels at most 63; at most 253 in all) or an IPv4/IPv6 literal, with at most one leading dot. It refuses@,?,#,%, ports, stray:, controls and spaces.prepare_for_import(crates/browser-pane/src/cookies/format.rs), where an invalid host counts as skipped as official'scookieDetailswould, and the engine'sto_cef_cookie, which every write goes through.urland requires no user info, no password, no port, and the same host.[or{) instead of anuntaggedenum, so the text is parsed once.require_settings_callerrequiresin_flight.is_empty()(merged fromdev). The picker title is cut to 200 characters with control characters removed.CookiesImportedanswers, through a newBrowserHost::take_profile_events_matching. Every other profile event stays queued for whoever asked for it.prepare_for_importis now called: expired, nameless or invalid-host cookies count as skipped, not failed.Store limits (parity): official's
writeCookies(profile/import.ts:10-38atdb2d889c) writes every cookie with no per-site cap and no warning, and Chromium evicts past its own limits. Ours does the same; recorded inours.md.Proof (
proof/previews/cookie-file/import-after.json, scratch engine profile):[email protected](as a__Host-cookie),github.com?x=…,github.com#…,github.com:8443,github%2ecomand0x7f.1were all refused: imported 0, failed 6, and no cookie exists on any github host..example.test,app.example.testand[::1]were imported (3).