Element Observer
Import
Section titled “Import”import { waitForElementWithObserver, waitForElementWithPolling,} from "webotron/plugins/element-observer";Entry Points
Section titled “Entry Points”waitForElementWithObserver(view, options)waitForElementWithPolling(view, options)
await waitForElementWithObserver(view, { selector: ".result", timeoutMs: 5000, observerMode: "shared", sharedObserverTtlMs: 2000,});Options
Section titled “Options”| Option | Type | Purpose |
|---|---|---|
selector | string | CSS selector to wait for. |
timeoutMs | number | Maximum wait duration. |
strategy | observer | poll | Waiting strategy. |
observerMode | per-request | shared | Observer allocation strategy. |
sharedObserverTtlMs | number | Shared observer idle teardown window. |
signal | AbortSignal | Abort-aware waiting (poll mode). |
per-request: one observer per pending request.shared: one reusable observer with TTL cleanup.
ChromeWebView.waitForElement() routes through this module under the hood.