Skip to main content

Module eval

Module eval 

Source
Expand description

browser-control eval — evaluate a JS expression in a page.

Three routing paths, picked by what the caller supplies:

  1. eval <browser>/<tab> — named-tab path. Resolves <tab> in the tabs SQLite table via the engine-agnostic [TabBackend]; if missing, returns TabNotFound so the agent can tab open <browser>/<tab> first. Mutually exclusive with --target. Works for both CDP and BiDi browsers.
  2. eval <browser> with no --target — routes through the daemon-style scratch tab with recover-once. The default, and the architectural fix for the iLO failure mode: lock-free eval never silently lands on a user’s admin tab. Engine-agnostic.
  3. eval <browser> --target <regex> — explicit selector against a user tab matching the URL regex. The original behaviour, kept for ad-hoc targeted use.

The shared preamble and the named-tab arm live in crate::cli::route; see that module for the routing-path overview. The bare-browser arm here is scratch-with-recover-once (the iLO fix), and the External-endpoint fallback is the legacy direct attach.

Functions§

run