Files
camoufox-rs/docs/reference-cli.md
T
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

24 KiB

CLI Reference: camoufox

Command-line interface reference for the camoufox executable.

The camoufox CLI communicates with a background daemon over a Unix domain socket using newline-delimited JSON messages.


Global Options

The following flags are available across all subcommands:

  • --socket <SOCKET>: Path to the daemon Unix socket.
    • If omitted, defaults to $XDG_RUNTIME_DIR/camoufox/daemon.sock when XDG_RUNTIME_DIR is set.
    • Otherwise, defaults to /tmp/camoufox-<uid>/daemon.sock.
    • For the default path, the runtime directory must be a real directory owned by the current UID with no group or other permissions (mode & 0o077 == 0). Symlinks and non-owner access are rejected.
    • If an explicit --socket <SOCKET> path is passed, this directory policy is skipped and only an existing parent directory is required.
  • --json: Output response as JSON instead of formatted text.
  • -h, --help: Print help.

JSON Response Envelope

When --json is supplied, every command outputs a top-level DaemonResponse JSON envelope:

{
  "ok": true,
  "data": { ... }
}

On daemon or execution errors, the envelope returns:

{
  "ok": false,
  "error": "error description"
}

and the process exits with code 1. Client-side argument validation errors exit with code 2.

Commands that return a void result (such as stop and shutdown) return {"ok": true} with no data field. For commands that produce output data, the "JSON output shape" blocks documented below represent the inner payload of this data field.


Subcommands Index

Subcommand Description
serve Start the daemon process
launch Launch a new browser instance
dialog Accept or dismiss an open JavaScript dialog
list List all running browser instances
stop Stop a browser instance
new-page Create a new page in a browser instance
navigate Navigate a page to a URL
evaluate Evaluate JavaScript on a page
click Click an element by CSS selector, or at viewport coordinates (x, y)
screenshot Take a screenshot of a page
shutdown Shut down the daemon and all browser instances
ping Ping the daemon
cookies Export all cookies for a browser instance (including HttpOnly)
text Print the page's visible text (innerText), optionally scoped to a selector
html Print page HTML: outerHTML of a selector, or the whole document
links List every <a href> on the page as text → href
data Extract structured page metadata (Open Graph / JSON-LD / meta tags)
url Print the page's current URL and title
back Go back one entry in the page's session history
forward Go forward one entry in the page's session history
reload Reload the page
wait Poll until an element matching a CSS selector exists
cookie Set a cookie for the instance's browser context: name=value
header Set an extra HTTP request header for a page: Name: value
fill Focus the element matching a selector, clear it, and type a value into it
type Type text into whatever element currently has focus
press Press a named key (Enter, Tab, Escape, ArrowDown, a, 1, …)
hover Move the mouse over the element matching a selector (no click)
select Choose an option in a <select> by value, label, or visible text
scroll Scroll an element into view, or scroll to the bottom of the page
tabs List the open pages (tabs) of an instance with their URLs and titles
close-tab Close a page (tab)
downloads View or wait for downloads on an instance

Subcommand Specifications

serve

Start the daemon process.

Usage: camoufox serve [OPTIONS]
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON instead of human-readable text.

launch

Launch a new browser instance managed by the daemon. Returns a generated instance ID (e.g. 00000001).

Usage: camoufox launch [OPTIONS]
  • --headed: Run in headed mode (show browser window). Default is headless.
  • --executable <EXECUTABLE>: Path to the Camoufox executable. If omitted, resolves via CAMOUFOX_BIN, then the active or newest install under ~/.cache/camoufox/browsers/ (from camoufox fetch), then ~/.cache/camoufox/camoufox.
  • --downloads-dir <DOWNLOADS_DIR>: Directory to save downloads to (must be absolute; defaults to cancel).
  • --bypass-csp: Disable page Content-Security-Policy (needed for --main-world on strict-CSP sites; detectable by pages).
  • --dialogs <DIALOGS>: JavaScript dialog handling policy (manual, accept, dismiss) [default: manual].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "instance_id": "00000001",
  "version": "Firefox/158.0.1-beta.41",
  "pid": 12345
}

dialog

Accept or dismiss an open JavaScript dialog.

Usage: camoufox dialog [OPTIONS] <INSTANCE_ID> <PAGE_ID> <ACTION>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID (e.g. p1).
  • <ACTION>: Action to take on the dialog (accept or dismiss).
  • --text <TEXT>: Response text to submit when accepting a prompt dialog.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "dialog_action": "accept",
  "dialog": {
    "id": "1",
    "kind": "alert",
    "message": "Hello world",
    "default_value": ""
  }
}

list

List all running browser instances.

Usage: camoufox list [OPTIONS]
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

Text mode prints one line per instance formatted as <instance_id> pid=<pid> version=<version> pages=[<pages>] (or no running instances if empty).

JSON output shape:

{
  "instances": [
    {
      "instance_id": "00000001",
      "pid": 3511172,
      "version": "Firefox/158.0.1-beta.41",
      "pages": []
    }
  ]
}

stop

Stop a browser instance.

Usage: camoufox stop [OPTIONS] <INSTANCE_ID>
  • <INSTANCE_ID>: Instance ID (e.g., 00000001).
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

Text mode prints ok. On success, --json returns {"ok": true} with no inner data payload.

new-page

Create a new page in a browser instance.

Usage: camoufox new-page [OPTIONS] <INSTANCE_ID>
  • <INSTANCE_ID>: Instance ID.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "page_id": "p1"
}

navigate

Navigate a page to a URL.

Usage: camoufox navigate [OPTIONS] <INSTANCE_ID> <PAGE_ID> <URL>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID (e.g., p1).
  • <URL>: URL to navigate to.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --wait-until <WAIT_UNTIL>: If set, block until the named lifecycle event fires after navigation. Supported values: load, domcontentloaded.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "navigation_id": "1",
  "status_code": 200
}

evaluate

Evaluate JavaScript on a page.

Usage: camoufox evaluate [OPTIONS] <INSTANCE_ID> <PAGE_ID> <EXPRESSION>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <EXPRESSION>: JavaScript expression to evaluate.
  • --main-world: Run in the page's main world so page-defined globals are visible (sync expressions only; detectable by the page; blocked by strict CSP).
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "result": "Example Domain"
}

click

Click an element by CSS selector, or at viewport coordinates (x, y).

Usage: camoufox click [OPTIONS] <INSTANCE_ID> <PAGE_ID> <TARGET> [Y]
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID (e.g., p1).
  • <TARGET>: CSS selector, or the integer X coordinate (i32) when an integer Y coordinate follows. Supports >>> shadow piercing.
  • [Y]: Integer Y coordinate (i32, viewport pixels). When present, <TARGET> is parsed as the integer X coordinate.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes). Ignored in coordinate click mode.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30]. Ignored in coordinate click mode (which uses a fixed 60s deadline).
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "clicked": true,
  "selector": "button#submit",
  "x": 100,
  "y": 200
}

Notes:

  • In coordinate click mode (camoufox click <id> <page> <x> <y>), the "selector" key is omitted.
  • If a JavaScript dialog was opened as a consequence of the click, a "dialog": {...} key is appended.
  • If file downloads were initiated during the click, a "downloads": [...] list is included.

screenshot

Take a screenshot of a page.

Usage: camoufox screenshot [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • -o, --output <OUTPUT>: Output file path. If omitted, defaults to screenshot-<instance_id>-<page_id>.<ext> inside the daemon runtime directory (e.g. $XDG_RUNTIME_DIR/camoufox/screenshot-00000001-p1.png).
  • --format <FORMAT>: Image format: png or jpeg [default: png].
  • --quality <QUALITY>: JPEG quality (0-100).
  • --selector <SELECTOR>: Crop to the element matching this CSS selector.
  • --clip <CLIP>: Clip region as x,y,width,height in CSS pixels. Mutually exclusive with --selector.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "bytes": 54321,
  "path": "/run/user/1000/camoufox/screenshot-00000001-p1.png",
  "clip": {
    "x": 0.0,
    "y": 0.0,
    "width": 1280.0,
    "height": 720.0
  }
}

shutdown

Shut down the daemon and all browser instances in parallel.

Usage: camoufox shutdown [OPTIONS]
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

Text mode prints ok. On success, --json returns {"ok": true} with no inner data payload. The socket file is removed; the <socket>.lock file is intentionally kept to prevent daemon startup race conditions.

ping

Ping the daemon.

Usage: camoufox ping [OPTIONS]
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "instance_count": 1
}

cookies

Export all cookies for a browser instance (including HttpOnly).

Usage: camoufox cookies [OPTIONS] <INSTANCE_ID>
  • <INSTANCE_ID>: Instance ID (e.g., 00000001).
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "cookies": [
    {
      "name": "session",
      "value": "abc",
      "domain": "example.com",
      "path": "/",
      "httpOnly": true,
      "secure": true
    }
  ]
}

text

Print the page's visible text (innerText), optionally scoped to a selector.

Usage: camoufox text [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --selector <SELECTOR>: Restrict extraction to the first element matching this CSS selector.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "text": "Hello world"
}

html

Print page HTML: outerHTML of a selector, or the whole document.

Usage: camoufox html [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --selector <SELECTOR>: Return the outerHTML of the first element matching this CSS selector.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "html": "<html><body><h1>Title</h1></body></html>"
}

List every <a href> on the page as text → href.

Usage: camoufox links [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --selector <SELECTOR>: Only collect links inside the element matching this CSS selector.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "links": [
    {
      "text": "Documentation",
      "href": "https://example.com/docs"
    }
  ]
}

data

Extract structured page metadata (Open Graph / JSON-LD / meta tags). With no flags, all three groups are returned.

Usage: camoufox data [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --og: Include Open Graph (og: / twitter:) tags.
  • --jsonld: Include application/ld+json blocks.
  • --meta: Include named <meta> tags.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "title": "Test Page",
  "url": "https://example.com/",
  "og": {
    "og:title": "OG Title"
  },
  "meta": {
    "description": "Page description"
  },
  "jsonld": []
}

Notes:

  • title and url are always included in the returned object.
  • Metadata keys in og retain their full prefix. The --og flag extracts all Open Graph and social tags matching /^(og|twitter|article|fb|al):/i (including twitter:, article:, fb:, and al: tags).

url

Print the page's current URL and title.

Usage: camoufox url [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "url": "https://example.com/",
  "title": "Example Domain"
}

back

Go back one entry in the page's session history.

Usage: camoufox back [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "navigated": true,
  "direction": "back"
}

forward

Go forward one entry in the page's session history.

Usage: camoufox forward [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "navigated": true,
  "direction": "forward"
}

reload

Reload the page.

Usage: camoufox reload [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "reloaded": true
}

wait

Poll until an element matching a CSS selector exists.

Usage: camoufox wait [OPTIONS] --selector <SELECTOR> <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --selector <SELECTOR>: CSS selector to wait for (required). Supports >>> shadow piercing.
  • --timeout <TIMEOUT>: Give up after this many seconds [default: 10].
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "found": true,
  "selector": "#content",
  "waited_ms": 150
}

Set a cookie for the instance's browser context: name=value.

Usage: camoufox cookie [OPTIONS] <INSTANCE_ID> <PAGE_ID> <PAIR>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID (used to derive cookie URL when neither --url nor --domain is given).
  • <PAIR>: Cookie as name=value.
  • --url <URL>: Associate the cookie with this URL instead of the page's current URL.
  • --domain <DOMAIN>: Cookie domain (mutually exclusive with --url).
  • --path <PATH>: Cookie path.
  • --secure: Mark the cookie Secure.
  • --http-only: Mark the cookie HttpOnly.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "cookie_set": "session_id",
  "domain": null,
  "url": "https://example.com/",
  "value": "xyz123"
}

--domain and --url are mutually exclusive: with --domain the response has "url": null; with --url (or the page-URL default) it has "domain": null.

header

Set an extra HTTP request header for a page: Name: value. Headers accumulate across calls for the lifetime of the page.

Usage: camoufox header [OPTIONS] <INSTANCE_ID> <PAGE_ID> <PAIR>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <PAIR>: Header as Name: value.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "header_set": "Authorization",
  "headers": [
    {
      "name": "Authorization",
      "value": "Bearer token"
    }
  ]
}

fill

Focus the element matching a selector, clear it, and type a value into it.

Usage: camoufox fill [OPTIONS] <INSTANCE_ID> <PAGE_ID> <SELECTOR> <VALUE>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <SELECTOR>: CSS selector of the input, textarea, or contenteditable.
  • <VALUE>: Value to type.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "filled": true,
  "selector": "input#username",
  "tag": "input",
  "value": "admin"
}

type

Type text into whatever element currently has focus.

Usage: camoufox type [OPTIONS] <INSTANCE_ID> <PAGE_ID> <TEXT>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <TEXT>: Text to insert.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Overall command timeout in seconds [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "typed": "my-text"
}

press

Press a named key (Enter, Tab, Escape, ArrowDown, a, 1, ...).

Usage: camoufox press [OPTIONS] <INSTANCE_ID> <PAGE_ID> <KEY>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <KEY>: Key name.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Overall command timeout in seconds [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "pressed": "Enter"
}

If the key press opens a JavaScript dialog, the response also carries a "dialog": {...} object describing it.

hover

Move the mouse over the element matching a selector (no click).

Usage: camoufox hover [OPTIONS] <INSTANCE_ID> <PAGE_ID> <SELECTOR>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <SELECTOR>: CSS selector.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "hovered": true,
  "selector": "a.menu",
  "x": 50,
  "y": 120
}

select

Choose an option in a <select> by value, label, or visible text.

Usage: camoufox select [OPTIONS] <INSTANCE_ID> <PAGE_ID> <SELECTOR> <VALUE>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • <SELECTOR>: CSS selector of the <select> element.
  • <VALUE>: Option value, label, or text to select.
  • --frame <FRAMES>: Scope to an iframe matching this selector (repeatable for nested iframes).
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "selected": true,
  "selector": "select#country",
  "option_value": "US",
  "option_text": "United States"
}

scroll

Scroll an element into view, or scroll to the bottom of the page.

Usage: camoufox scroll [OPTIONS] <INSTANCE_ID> <PAGE_ID> [SELECTOR]
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • [SELECTOR]: CSS selector to scroll into view. Omit to scroll to the page bottom.
  • --timeout <TIMEOUT>: Timeout in seconds for waiting for execution context [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "scrollX": 0,
  "scrollY": 2460.5,
  "scrollHeight": 3142
}

tabs

List the open pages (tabs) of an instance with their URLs and titles.

Usage: camoufox tabs [OPTIONS] <INSTANCE_ID>
  • <INSTANCE_ID>: Instance ID.
  • --timeout <TIMEOUT>: Per-page timeout in seconds for reading each tab's URL/title [default: 30].
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "tabs": [
    {
      "opener": null,
      "page_id": "p1",
      "title": "Example Domain",
      "url": "https://example.com/"
    }
  ]
}

Notes:

  • Each tab item contains page_id, url, title, and opener (or null).
  • An item may also contain "crashed": true if the page process terminated abnormally, or "dialog": {...} if an unhandled JavaScript dialog is currently open.
  • When a page has not navigated or is unreadable, url and title can be null or empty strings.

close-tab

Close a page (tab).

Usage: camoufox close-tab [OPTIONS] <INSTANCE_ID> <PAGE_ID>
  • <INSTANCE_ID>: Instance ID.
  • <PAGE_ID>: Page ID.
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "closed_page": "p1"
}

downloads

View or wait for downloads on an instance.

Usage: camoufox downloads [OPTIONS] <INSTANCE_ID>
  • <INSTANCE_ID>: Instance ID.
  • --wait <WAIT>: Optional timeout in seconds to wait for download events. Returns on the next download event (start or finish) or after the timeout; re-run until the entry is completed, failed, or canceled (see Downloads and Dialogs).
  • --socket <SOCKET>: Path to the daemon Unix socket.
  • --json: Output as JSON.

JSON output shape:

{
  "downloads": [
    {
      "uuid": "8a2f1b74-3c6d-4e9f-9a1b-2c3d4e5f6a7b",
      "url": "https://example.com/file.zip",
      "suggested_filename": "file.zip",
      "page_target_id": "target-456",
      "page": "p1",
      "state": "completed",
      "error": null,
      "path": "/tmp/downloads/8a2f1b74-3c6d-4e9f-9a1b-2c3d4e5f6a7b"
    }
  ]
}

Each entry in the downloads array is a DownloadEntry object.