GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(browser): import a cookie file from Settings > Browser by Hona · Pull Request #415 · anomalyco/opencode-rune

Conversation

@Hona

@Hona Hona commented Nov 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Adds "Import cookie file" to Settings > Browser > Advanced, using WS-1's #286 cookie store. It matches official anomalyco/opencode at b9a60d9d078d87bfb90f039e431090508f88ac02.

Official reference (b9a60d9d078d87bfb90f039e431090508f88ac02)

  • The row, settings.tsx:230-255:
    • Its second card in Advanced, with title settings.import.file.title and description settings.import.file.description.
    • A Choose file button that shows busy while the import runs.
    • When an import finishes, its outcome replaces the description, in red if it failed.
  • The file picker, settings.tsx:56-61: titled settings.import.file.pick and limited to txt and json files.
  • Reading the file, profile/index.ts:503-516 (importFile): files over 32 MiB are refused; a file that cannot be read gives read; a file that does not parse gives format.
  • Outcome messages, jobs.ts:186-276:
    • Failures: signins.failed.read.file, signins.failed.format, signins.failed.storage.
    • Some cookies lost: signins.imported.incomplete (count plus the number skipped).
    • Otherwise: signins.imported (count).
    • No answer from the app: settings.failed.import.
  • Time limit, jobs-machine.ts:87: the import fails after 60 s without an answer.

Changes

  • apps/desktop/src/surfaces/browser/cookie_import.rs (new):
    • The app shows the OS file picker itself, so a plugin never supplies a path.
    • feat(browser): enable real OS cookie encryption, CefCookieManager, remote cookie mirror, and Rust cookie importer #286's read_cookie_file reads and checks the file: regular files only, at most 32 MiB, Netscape cookies.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.
    • If the engine is idle, it is started, and the cookies go in through BrowserHost::import_profile_cookies once the engine's cookie store is up.
    • One import at a time; it fails after 60 s without an answer. The engine's results are routed back here (pump_cookie_import drains take_profile_events).
  • Browser:ImportCookieFileAsync(title): only the built-in browser plugin can call it. MCP tools and other plugins get browser.cookies.denied.
  • Settings: the row with official's messages and busy state. Now that both the remote-sign-ins and cookie-file rows exist, the Advanced summary shows official's full text.
  • Strings: 9 English keys with official's names and text.

Not in this PR

  • Saving check: official checks first that imported sign-ins can be saved to disk (persistent, which fails as storage). 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 3bc4a37

  1. Cookie host validated (critical):
    • valid_cookie_host accepts 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.
    • It runs in two places: prepare_for_import (crates/browser-pane/src/cookies/format.rs), where an invalid host counts as skipped as official's cookieDetails would, and the engine's to_cef_cookie, which every write goes through.
    • The engine then parses the cookie's URL with url and requires no user info, no password, no port, and the same host.
  2. Large files (critical):
    • The file is read and parsed on a worker thread.
    • The JSON shape is chosen by its first byte ([ or {) instead of an untagged enum, so the text is parsed once.
    • Cookies go to the engine in batches of at most 1,000 cookies or about 2 MiB, one wire line each.
    • The 60 s limit restarts at every answered batch. The import fails at once if the engine goes away.
  3. Caller guard and picker title: require_settings_caller requires in_flight.is_empty() (merged from dev). The picker title is cut to 200 characters with control characters removed.
  4. Other callers' engine answers are kept: the import takes only its own CookiesImported answers, through a new BrowserHost::take_profile_events_matching. Every other profile event stays queued for whoever asked for it.
  5. prepare_for_import is now called: expired, nameless or invalid-host cookies count as skipped, not failed.

Store limits (parity): official's writeCookies (profile/import.ts:10-38 at db2d889c) writes every cookie with no per-site cap and no warning, and Chromium evicts past its own limits. Ours does the same; recorded in ours.md.

Proof (proof/previews/cookie-file/import-after.json, scratch engine profile):

  • Hostile hosts: [email protected] (as a __Host- cookie), github.com?x=…, github.com#…, github.com:8443, github%2ecom and 0x7f.1 were all refused: imported 0, failed 6, and no cookie exists on any github host.
  • Valid hosts: .example.test, app.example.test and [::1] were imported (3).
  • Large import: 60,000 cookies (13.2 MB of cookie text) went in 60 lines, the largest 337 KB, far under the engine's 32 MiB line cap. All 60,000 were imported, 0 failed, in 54 s.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Hona added 3 commits November 21, 2026 15:39
@Hona
feat(browser): import a cookie file from Settings > Browser
c4b9143
@Hona
Merge remote-tracking branch 'origin/dev' into browser-settings/pr2b
a6d5275
# Conflicts:
#	apps/desktop/src/plugin_host/native/browser.rs
#	apps/desktop/src/surfaces/browser/mod.rs
@Hona
fix(browser): validate cookie hosts, batch file imports, and parse th…
3bc4a37
…em off the UI thread (READER-12 #415)
@Hona Hona mentioned this pull request Nov 21, 2026
feat(browser): offer sign-ins and history from another browser on the pane #550
Merged
@github-actions

github-actions Bot commented Nov 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Hona added 3 commits November 21, 2026 22:44
@Hona
Merge remote-tracking branch 'origin/dev' into browser-settings/pr2b
694ee6d
@Hona
Merge remote-tracking branch 'origin/dev' into browser-settings/pr2b
ced7b98
@Hona
fix(browser): skip cookies past the engine's field caps before batchi…
8917603
…ng (READER-12 #415 follow-up)
@Hona
Hona merged commit 3f474f9 into dev Nov 21, 2026
@Hona
Hona deleted the browser-settings/pr2b branch November 21, 2026 12:55
@Hona Hona mentioned this pull request Nov 21, 2026
chore(browser): bump ENGINE_REVISION to 7 after 156.0.26-6 published #579
Merged
Hona added a commit that referenced this pull request Nov 21, 2026
@Hona
feat(browser): offer sign-ins and history from another browser on the…
74b2ca7
… 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
@Hona

Hona commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Smoke after merge (FLEET.md:156, missed before the merge): #550's PR CI build 6e85ed3 contains this PR; tools/smoke.ps1 9/9 (plugins load, settings 14/14 incl. browser, browser tab loads, clean quit). Lines on #550.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Hona Hona mentioned this pull request Nov 21, 2026
feat(browser): Sign-ins and Browsing history boxes in the import dialog #611
Merged
Hona added a commit that referenced this pull request Nov 21, 2026
@Hona
feat(browser): Sign-ins and Browsing history boxes in the import dial…
7de78ef
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Hona
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.