Skip to content

Evaluation and Waiting

ChromeWebView.evaluate() uses a queued mutex by default so only one evaluation runs at a time. That keeps runtime behavior deterministic.

For independent work, pass mode: "non-blocking" to bypass the queue.

waitForElement() supports two strategies:

  • observer: uses a MutationObserver inside the page.
  • poll: checks the DOM repeatedly on a timer.

The observer strategy also supports two modes:

  • per-request: one observer per pending request.
  • shared: one observer reused across requests, with TTL-based cleanup.
  • Use observer for fast DOM reactions.
  • Use poll when you need abort behavior or simpler timing.
  • Use shared when many requests target the same page and you want to avoid setting up multiple observers.