Commit Graph
6 Commits
Author SHA1 Message Date
9prodhiandClaude Opus 5.5 c6cd4595f7 fix(config): find the browser where current Camoufox installs it
The CLI daemon, integration tests and web_browse example each resolved the
browser as $CAMOUFOX_BIN, else ~/.cache/camoufox/camoufox. Current Camoufox
(`python -m camoufox fetch`) installs to
~/.cache/camoufox/browsers/<repo>/<version>/camoufox and records the active
one in ~/.cache/camoufox/config.json, so a fresh install failed with
"failed to spawn browser ... No such file or directory" unless the path was
passed by hand.

Add camoufox::config::default_executable(), mirroring the Python package's
lookup, and use it from all three places:

1. $CAMOUFOX_BIN, if set and non-empty
2. active_version from <cache>/config.json, if its executable exists
3. the newest browsers/<repo>/<version>/camoufox (natural version order)
4. the legacy <cache>/camoufox, returned even if missing

<cache> honours an absolute $XDG_CACHE_HOME, else $HOME/.cache/camoufox.
An empty CAMOUFOX_BIN is now treated as unset.

Docs (README, CLI and library references, tutorial, how-to), CHANGELOG and
the camoufox-browse skill note are updated; plugin bumped to 1.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:34:15 -06:00
9prodhiandClaude Opus 5.5 75093b9db1 docs(skill): bring camoufox-browse skill and hooks up to date with the CLI
The skill was last touched before frames, shadow DOM, dialogs, downloads
and --bypass-csp landed, and was missing frontmatter so Claude Code could
not decide when to load it.

- SKILL.md: add name/description frontmatter; resolve the browser binary
  (CAMOUFOX_BIN, legacy path, or newest browsers/official/<ver>/ install)
  and pass launch --executable; document --frame, >>>, dialog/--dialogs,
  downloads/--downloads-dir, --bypass-csp, isolated vs main-world
  evaluate, exit codes, timeouts, popups-in-tabs; fix the default
  screenshot path; add navigate caveats (non-2xx is ok, unreachable
  hosts block until --timeout).
- hook.json: regenerate with valid escaping; daemon start now backgrounds
  only `serve`, logs to a file and waits; read pages with `text`, search
  via DuckDuckGo; no-op when the CLI is not installed.
- marketplace.json: add required `owner` (validation failed without it).
- Bump plugin to 1.1.0 so installed copies pick up the change.

Verified with `claude plugin validate` and a live walkthrough against
Camoufox 158.0.1-beta.41.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:03:33 -06:00
9prodhiandClaude Opus 5.5 b8b5ddc039 feat(cli): evaluate --main-world to read page-defined globals
On Camoufox 158, `evaluate` runs in an isolated world and can't see
globals set by page scripts (window.__NEXT_DATA__, app state). The new
flag routes through MainFrame::evaluate_main_world. Sync expressions
only, observable by the page, blocked by strict CSP (documented in the
skill). DaemonRequest::Evaluate gains `main_world` with serde default, so
older clients keep working. Integration test proves isolated vs main
world on a real browser.

Implemented via pi (openai/gpt-6.1-sol); reviewed and gate-verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:09:15 -06:00
9prodhiandClaude Opus 5.5 6260276d0e fix(cli): evaluate errors, cookie output, screenshot paths, config validation
- `evaluate` goes through eval_checked: undefined -> null, page exceptions
  -> error (previously ok:true with the raw protocol envelope).
- `cookies` count goes to stderr so `cookies I > jar` stays clean.
- `screenshot -o` relative paths resolve against the client's cwd, not
  the daemon's.
- Remove the no-op `serve --foreground` flag.
- LaunchConfig::validate is called at the top of spawn (no more panic on
  a missing profile); juggler-arg check strips all leading dashes.
- Plugin skill/hook use CAMOUFOX_CLI for the CLI binary; CAMOUFOX_BIN
  keeps meaning the browser executable.
- Click integration fixture records its result in the DOM: evaluate runs
  in an isolated world on Camoufox 158 and can't see page globals.
- rust-version = 1.85 (clap 4.5 needs 1.74, getrandom 0.4 needs 1.85).

Implemented via pi (openai/gpt-6.1-sol); reviewed and gate-verified
(clippy io_other_error lint in readiness.rs fixed at merge).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 06:29:10 -06:00
9prodhiandClaude Opus 4.8 aad0c54bfb feat(cli): add 20-command browsing surface; prep repo for public release
Grow the CLI from 12 primitives to a full browsing/scraping surface. Every new
command is a thin CLI/IPC wrapper over the existing `api` layer (no new protocol
plumbing), and `output.rs` is refactored into a pure, testable `render()`:

- Reading: text, html, links, data (og/jsonld/meta), url
- Navigation/waiting: wait, reload, back, forward
- Cookies/headers: cookie, header
- Interaction: click (selector or x,y trusted event), fill, type, press,
  hover, select, scroll
- Tabs: tabs, close-tab
- screenshot --selector / --clip, and a viewport-origin default clip

Public-release preparation and review hardening:

- Add MIT LICENSE and repository metadata to Cargo.toml
- Make the camoufox-browse plugin portable: discover the binary via
  $CAMOUFOX_BIN / PATH / ./target/release instead of hardcoded container paths
  (SKILL.md and hook.json)
- Sanitize internal client references from docs and code comments
- CHANGELOG: list the new commands under Added (not Changed)
- wait_for_selector fails fast on invalid selectors instead of burning the
  full timeout under the daemon lock
- Correct punctuation keyCodes in key_descriptor (`press .` no longer collides
  with Delete's keyCode)
- Add --timeout to the tabs command
- Document the daemon's serial-execution behavior in README
- Add integration tests: trusted click, reading, interaction, screenshot
  scroll-offset regression, and wait fail-fast

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-14 14:59:10 +00:00
9prodhi 95f91af19f initial camoufox-rs release (API, protocol transport, CLI daemon, tests) 2026-03-03 00:08:40 +00:00