Skip to main content

Module engine

Module engine 

Source
Expand description

The Engine trait — the daemon’s view of “a browser”.

The trait is small, synchronous, and platform-agnostic. The daemon drives an Engine from a Tokio context but never directly: every call is dispatched onto the engine’s dedicated thread (see crate::runtime), where the platform-specific WebKit port runs.

For the live wire types — Tree, [Node], Ref, [Role], Op — see vs_protocol.

Structs§

AuthBlob
Opaque encrypted-by-the-engine auth payload. The daemon hands the bytes to vs_store for at-rest encryption.
ClickOpts
Button, count and modifiers of a CursorOp::Click.
CookieData
On-wire representation of one cookie. Field names use snake_case for the JSON; the engines convert to and from their native cookie types.
Dialog
A JavaScript dialog a page is blocked on.
DialogAnswer
How a dialog is closed: OK (with a prompt’s text) or Cancel.
Download
One download the engine holds in memory, on its way to disk.
DownloadEntry
A captured download intent, without its payload. Listed by Engine::download_list so an agent can see what the page tried to save before committing to reading any of it.
DropData
What Engine::drop_data drops onto a page: files from disk and string items keyed by MIME type, as a drag from another application would carry them.
EngineCapabilities
What an engine declares it can and cannot do.
LayoutBox
Result of Engine::layout: the computed box for a single ref.
Modifiers
Modifier keys held during a CursorOp::Click.
PageHandle
An opaque engine-side handle to a page. The daemon associates each PageHandle with one pages row in vs-store.
Popup
A page another page opened (see Engine::set_popups).
PopupFeed
See Engine::popup_feed. Carries dialogs too: they need the same off-thread path, since the page’s script is blocked until answered.
RecFrame
One recorded frame streamed from the engine during automation.
Viewport
A viewport definition. Sizes are in CSS pixels; dpr is the device-pixel ratio.

Enums§

ActTarget
What Engine::act targets on a page.
Action
What Engine::act does at the target.
CaptureScope
Scope of a Engine::capture call.
CookieOp
What Engine::cookies does to the jar.
CursorOp
Coordinate-addressed input operations: vs move-to, vs click-at, vs hover-at, vs drag. Native event dispatch on backends that support it (macOS today; Linux + Windows fall through to ENGINE_UNSUPPORTED until M7 wires GDK / CDP input).
DataStore
Which browser data store (cookies, localStorage, IndexedDB, cache) a new page uses.
DownloadSource
What Engine::download should hand back.
EngineError
What can go wrong when driving an engine.
InputMode
Input humanization mode. Wire form: --mode={human,careful,robotic}.
MouseButton
Which mouse button a CursorOp::Click presses.
NodeRole
The role a node in Node would carry — re-exported for convenience. A11y role code as it appears on the wire.
OpenStart
How Engine::open_start went: the page is open, or its first load is still running and Engine::open_poll with this ticket finishes it.
PopupEvent
One entry of a PopupFeed.
WaitCondition
A condition for Engine::wait.

Constants§

DEFAULT_USER_AGENT
WebKitGTK is WebKit, so the Safari family is honest — but the OS token has to say Linux. Claiming Macintosh here contradicted navigator.platform, which reports the real platform: an inconsistency any fingerprinter cross-checks, and one we created.
DIALOG_TIMEOUT
A dialog nobody answers is dismissed after this long, so a page is never left blocked.

Traits§

Engine
The browser engine, as the daemon sees it.

Type Aliases§

EngineResult
Convenience Result with EngineError as the error type.