Answer HTTP basic/proxy auth challenges with these credentials. Returns an interceptor id for page/stop-intercept!. Owns the Fetch domain like page/on-request! — the two are mutually exclusive until stopped. A challenge the credentials already failed once is cancelled rather than re-answered, so a wrong password fails instead of looping.
Return the element's bounding box in main-viewport coordinates: {:x :y :width :height}. Auto-waits for the element to be visible. Options: :timeout ms.
Click the element matching sel with a real mouse event, auto-waiting until it is visible and enabled. Options: :timeout ms, :button (:left default, :right, :middle), :click-count, :modifiers (["Shift" "Meta" ...]).
Evaluate a JS expression inside a specific frame by id (see page/frames) and return its value. Runs in an isolated world, so it sees the frame's DOM but not its page-script variables.
Focus the element matching sel and replace its contents with text (real text-input events). Works on inputs, textareas, and contenteditable. Options: :timeout ms.
Return a frame handle for the child frame whose id, name, or URL (substring) matches spec. The handle works like a page for selector actions, page/eval, page/text, page/click, page/fill, page/snapshot, refs, ... — all scoped to that frame. Cross-origin frames that Chrome isolates into their own process (OOPIFs) are not in this page's tree; adopt those via browser/pages.
Navigate to url and wait for it. Options: :timeout ms (default 30000), :wait-until (:load default, :domcontentloaded, or :networkidle — no in-flight requests for 500ms).
Auto-respond to alert/confirm/prompt dialogs: action is :accept or :dismiss, with an optional prompt-text answer for prompt(). Registers a handler; returns its id (cdp/off! to remove). Without a handler an open dialog blocks the page's JS.
Intercept every request the page makes. The handler receives {:url :method :resource-type :headers :request-id} and returns :continue (or nil) to let it through, :abort to block it, {:fulfill {:status :headers :body}} to answer it without the network, or {:continue {:url :method :headers :post-data}} to rewrite it. Returns an interceptor id for page/stop-intercept!. One interceptor per page — stop the old one first.
Print the page to PDF (headless only). Returns the bytes, or writes to :path and returns the path. Options: :path, :landscape #t, :scale (0.1-2), :page-ranges ("1-3").
Focus the element matching sel and press a key or chord: "Enter", "Tab", "Escape", arrows, any single character, or with modifiers ("Control+a", "Meta+Shift+r"). Options: :timeout ms.
Return the body of a recorded response by its :request-id (from page/requests or page/wait-for-response). Text bodies come back as a string, binary ones as a bytevector. Requires page/track-network!, and the body must still be held by the browser (it is dropped on navigation). Retries briefly while the response is still streaming.
Capture a screenshot as PNG bytes. Options: :path (write to file and return the path instead), :format ("png" default, "jpeg", "webp"), :quality (0-100, jpeg/webp), :full-page (capture beyond the viewport), :selector (capture just that element).
Set a <select> and fire input/change events. `value` is an option value string, a list of values (multi-select), or {:label "visible text"}. Non-select elements get their value assigned directly. Options: :timeout ms.
Set one cookie. Map keys: :name and :value (required), plus :url or :domain, :path, :expires (unix seconds), :httpOnly, :secure, :sameSite. Raises when the browser rejects it.
Emulate media features: {:color-scheme "dark"|"light"} for prefers-color-scheme, {:media "print"} for print styles, {:reduced-motion "reduce"}. Pass {} to reset.
Render the page's accessibility tree as compact text, one node per line with a [ref=eNNN] handle usable with page/click-ref and page/fill-ref. On a frame handle, renders that frame's tree.
Record the page as numbered PNG frames into dir (created if missing) until page/stop-screencast!. Frames arrive while commands run — use (cdp/pump pg ms) to capture during idle stretches. Returns a handle for page/stop-screencast!.
Focus the element matching sel and type text character by character with real key events — for pages reacting to each keystroke (autocomplete, masked inputs). Appends; use page/fill to replace. Options: :timeout ms.
Wait for the next download to finish and return {:path :filename :url}. Call page/downloads-to! first, then trigger the download (a click, a goto). Options: :timeout ms.