dsh-anti-detect-browser
v0.2.1
Published
Interactive browser tools for dsh (navigate/snapshot/click/fill/eval/screenshot/close). Dual backend: Camoufox anti-detect Firefox or local full Chromium via Playwright. Ref-based element snapshots; architecture mirrors the Hermes Agent browser tool.
Maintainers
Readme
dsh-anti-detect-browser
Interactive browser tools for dsh (DeepSeek Harness) — dual-backend, architecture mirrored from the Hermes Agent browser tool. Gives dsh's agent real page interaction: navigate, click, fill, evaluate JS, screenshot — not just static fetch.
Tools
| Tool | What it does |
|------|--------------|
| browser_navigate | Open a URL; returns title, page text and a numbered list of interactive elements |
| browser_snapshot | Re-list the current page (refs go stale after DOM changes) |
| browser_click | Click an element by ref, returns a fresh snapshot |
| browser_fill | Type text into an input/textarea ref (or select an option) |
| browser_eval | Evaluate JS in the page context (Chromium backend only) |
| browser_screenshot | Save a viewport PNG |
| browser_close | Close the session; next call starts fresh |
Both backends return the same shape: {url, title, text, elements} where each element is {ref, tag, kind, text, href}.
Backends
Selection follows the same semantics as Hermes's is_camofox_mode:
CAMOFOX_URLunset (default) → local full Chromium via Playwright. Executable discovery, in order:DSH_BROWSER_EXECUTABLE_PATH(also honorsAGENT_BROWSER_EXECUTABLE_PATH)- system Chrome/Chromium on PATH (
google-chrome,chromium,chromium-browser,chrome) - Playwright cache
chromium-*builds (newest first, bothchrome-linux64/andchrome-linux/layouts)
chromium_headless_shellis never used — no extension hooks, broken fonts/codecs, trivially fingerprinted. If no full Chromium exists the tool throws with install guidance instead of falling back.CAMOFOX_URLset → Camoufox (anti-detect Firefox) via the camofox-browser REST API. Tab 404 (server GC) auto-recreates, same as Hermes.browser_evalreturns an explicit unsupported error in this mode (the REST API has no JS eval).
Install
dsh plugin --profile web add dsh-anti-detect-browser -w
systemctl restart dsh-web # however you run dshTo enable the Camoufox backend, start a camofox-browser server (npm start in its checkout, or docker run -p 9377:9377 -e CAMOFOX_PORT=9377 jo-inc/camofox-browser) and inject the URL into dsh:
systemctl edit dsh-web # [Service] → Environment=CAMOFOX_URL=http://localhost:9377
systemctl restart dsh-webEnvironment variables
| Variable | Effect |
|----------|--------|
| CAMOFOX_URL | Switch to the Camoufox backend (server base URL) |
| CAMOFOX_USER_ID / CAMOFOX_SESSION_KEY | Share a browser identity with an external integration |
| DSH_BROWSER_EXECUTABLE_PATH | Force a specific Chromium binary (Chromium backend) |
| DSH_BROWSER_SHOT_DIR | Screenshot output directory (default <home>/workspace/dsh-browser-shots) |
Development
The published tarball contains only the runtime (index.js, cordis.patch.yml + manifest). The smoke tests — Chromium backend against real pages, Camoufox backend against a mock REST server (including the tab-GC 404-recreate path) — live in the plugin's source checkout, not in this package. At minimum run node --check index.js after any edit, then restart dsh.
How it differs from dsh-browser
The npm package dsh-browser (by ben7am1n) covers similar ground with a CSS-selector-driven toolset (fetch HTML → guess a selector → click). This plugin ports the Hermes Agent approach instead:
- Ref-based snapshots —
browser_navigate/browser_snapshotlist every visible interactive element with a stable ref; the agent clicks by ref in one call instead of fetching HTML and guessing selectors across two. - Camoufox anti-detect backend — set
CAMOFOX_URLand the same tools run on an anti-fingerprinting Firefox (camofox-browser REST API) with server-GC-safe tab handling; nothing like it exists indsh-browser. - Deterministic binary discovery — env override → system Chrome → Playwright cache; full
chromium-*builds only,chromium_headless_shellnever used.
License
MIT
