Background daemon that keeps a Playwright browser alive between CLI calls.
Listens on a Unix domain socket for JSON commands, executes them against the browser, and returns JSON responses. Each command is one JSON line; each response is one JSON line.
Usage: (start-daemon! {:session "default" :headless true}) ;; blocks (daemon-running? "default") ;; check (stop-daemon!) ;; cleanup
Background daemon that keeps a Playwright browser alive between CLI calls.
Listens on a Unix domain socket for JSON commands, executes them against
the browser, and returns JSON responses. Each command is one JSON line;
each response is one JSON line.
Usage:
(start-daemon! {:session "default" :headless true}) ;; blocks
(daemon-running? "default") ;; check
(stop-daemon!) ;; cleanup(daemon-running? session)Checks if a daemon is running for the given session.
Checks if a daemon is running for the given session.
(discover-cdp-endpoint)Auto-discovers a running Chrome's CDP endpoint. Checks DevToolsActivePort files first, then probes common ports (9222, 9229). Returns a CDP URL string (e.g. "http://127.0.0.1:9222") or throws ex-info.
Auto-discovers a running Chrome's CDP endpoint. Checks DevToolsActivePort files first, then probes common ports (9222, 9229). Returns a CDP URL string (e.g. "http://127.0.0.1:9222") or throws ex-info.
(flags-file-path session)Returns the launch flags persistence file path for a session.
Returns the launch flags persistence file path for a session.
(log-file-path session)Returns the log file path for a session.
Returns the log file path for a session.
(pid-file-path session)Returns the PID file path for a session.
Returns the PID file path for a session.
(read-session-flags session)Reads persisted launch flags for a session from the flags file. Returns a map of flag-name->value, or empty map if file doesn't exist. Used by CLI to recover flags like --cdp without requiring them on every command.
Reads persisted launch flags for a session from the flags file. Returns a map of flag-name->value, or empty map if file doesn't exist. Used by CLI to recover flags like --cdp without requiring them on every command.
(socket-path session)Returns the Unix socket path for a session.
Returns the Unix socket path for a session.
(start-daemon! opts)Starts the daemon server. Blocks until shutdown.
Params:
opts - Map:
:session - String (default 'default')
:headless - Boolean (default true)
:browser - String (optional, e.g. 'firefox', 'webkit')
:cdp - String (optional, CDP endpoint URL)
Starts the daemon server. Blocks until shutdown. Params: `opts` - Map: :session - String (default 'default') :headless - Boolean (default true) :browser - String (optional, e.g. 'firefox', 'webkit') :cdp - String (optional, CDP endpoint URL)
(stop-daemon!)Stops the daemon server and cleans up browser resources. Closes server socket first so new CLI invocations fail fast and start a fresh daemon. Only deletes PID/socket files if they still belong to THIS process (prevents nuking a replacement daemon's files).
Stops the daemon server and cleans up browser resources. Closes server socket first so new CLI invocations fail fast and start a fresh daemon. Only deletes PID/socket files if they still belong to THIS process (prevents nuking a replacement daemon's files).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |