Skip to content

Types

This page documents the full public option and enum surface exported from webotron.

PropertyTypeDefault in constructorDescription
chromePathstringsystem ChromeOptional executable path override.
headlessbooleanfalseHeaded by default. Set true for headless automation.
windowSize{ width: number; height: number }{ width: 1280, height: 800 }Initial viewport/window dimensions.
userDataDirstringresolved profile pathOptional explicit browser profile path.
profileChromeProfileOptionsshared temp profileControls default shared vs isolated profile behavior when userDataDir is not provided.
initialUrlstring""Initial URL for launch/connect flow.
appModebooleanfalseEnables app-style browser window mode.
argvstring | string[] | ChromeArgvMutatorundefinedAdds extra Chrome launch arguments or rewrites the generated argv list.
attachChromeAttachOptionsundefinedAttach to existing browser/target session.

(argv: string[]) => string[] | void

Receives the generated Chrome command argv list before launch. You can mutate the array in place or return a replacement array.

"shared" | "isolated"

PropertyTypeDescription
isolationChromeProfileIsolationUse "shared" for a stable temp profile path or "isolated" for a unique generated temp profile.
cleanupEphemeralbooleanDefaults to true for isolated profiles. Set false to keep a generated isolated profile after close().
PropertyTypeRequiredDescription
browserWSEndpointstringone of attach endpoints is requiredBrowser-level WebSocket endpoint.
pageWSEndpointstringone of attach endpoints is requiredPage target WebSocket endpoint.
devToolsPortnumberone of attach endpoints is requiredDevTools HTTP port used to discover target WS endpoint.
targetUrlStartsWithstringnoOptional target selection filter when discovering page target.
processIdnumbernoOptional known process ID for attach mode reporting.

Constructor validation requires at least one of: pageWSEndpoint, browserWSEndpoint, or devToolsPort.

"load" | "domcontentloaded" | "frameNavigated" | "responseReceived" | "eventSourceMessageReceived"

PropertyTypeDescription
timeoutMsnumberMax wait duration before navigation fails.
waitUntilNavigateWaitUntilNavigation milestone to wait for.
PropertyTypeDescription
timeoutMsnumberMax wait duration before failure.
state"interactive" | "complete"Required readyState threshold.

"observer" | "poll"

"per-request" | "shared"

PropertyTypeDescription
timeoutMsnumberMax wait duration for selector match.
intervalMsnumberPoll interval for poll strategy.
strategyWaitForElementStrategyWait algorithm (observer or poll).
observerModeWaitForElementObserverModeObserver lifecycle mode for observer strategy.
sharedObserverTtlMsnumberShared observer idle TTL before automatic cleanup.
signalAbortSignalOptional cancellation signal.

"queued" | "non-blocking"

PropertyTypeDescription
modeEvaluateModequeued serializes calls; non-blocking skips queueing.
PropertyTypeDescription
xnumberViewport X coordinate.
ynumberViewport Y coordinate.
sourcestringSource metadata for how target was resolved.

Opaque element reference returned by DOM query APIs.

PropertyTypeDescription
idstringInternal bridge reference ID for the current page context.
kind"element"Discriminator for handle-aware APIs.
PropertyTypeDescription
xnumberLeft coordinate in viewport pixels.
ynumberTop coordinate in viewport pixels.
widthnumberElement width.
heightnumberElement height.
PropertyTypeDescription
delayMsnumberOptional delay before click dispatch.

Extends ClickOptions.

PropertyTypeDescription
timeoutMsnumberMax selector resolution time before click.
PropertyTypeDescription
timeoutMsnumberMax time to resolve element point.
PropertyTypeDescription
altKeybooleanInclude Alt modifier.
ctrlKeybooleanInclude Ctrl modifier.
metaKeybooleanInclude Meta/Command modifier.
shiftKeybooleanInclude Shift modifier.
PropertyTypeDescription
perCharacterDelayMsnumberDelay between typed characters in milliseconds. Use 0 for fastest typing.
PropertyTypeDescription
exactbooleanMatch text exactly instead of using a partial case-insensitive match.

Extends LocatorMatchOptions.

PropertyTypeDescription
namestringAccessible name to match for the role query.
PropertyTypeDescription
block"start" | "center" | "end" | "nearest"Scroll alignment target for scrollIntoView.
timeoutMsnumberMax selector wait before scroll action.

"blob" | "buffer" | "base64" | "shmem"

"png" | "jpeg" | "webp"

PropertyTypeDescription
xnumberClip rectangle X coordinate.
ynumberClip rectangle Y coordinate.
widthnumberClip width.
heightnumberClip height.
scalenumberOptional clip scale factor.
PropertyTypeDescription
encodingScreenshotEncodingOutput encoding mode.
formatScreenshotFormatImage format.
qualitynumberCompression quality (format-dependent).
clipScreenshotClipOptionsOptional capture crop rectangle.