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>
Previously the CLI --timeout flag was dropped at Instance::navigate
(parameter declared _timeout, never forwarded) and the protocol-layer
Client::send blocked on bare rx.recv() with no deadline. A
Content-Disposition: attachment navigation produced no response, the
pending slot leaked, and the daemon needed kill -9.
This commit:
- Adds ProtocolError::Timeout variant.
- Adds Client::send_with_timeout that uses rx.recv_timeout and frees
the pending slot on timeout.
- Defaults Client::send to a 60s timeout (no call can hang forever).
- Adds a timeout parameter to MainFrame::navigate.
- Forwards Instance::navigate's CLI timeout through to the protocol
layer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
End-to-end example: launch Camoufox, build a context, get a MainFrame via
new_main_frame (which applies the cross-origin iframe attach fix), navigate,
poll for document.readyState=complete, extract title/URL/body text via
evaluate, take a screenshot, shut down cleanly.
Replaces the pre-fix scaffolded version that used the now-deleted Page API.
Declared as [[example]] name = "web_browse" in Cargo.toml.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>