Expand description
QuickJS bindings for ferridriver core types.
Wrappers live here (one module per core type) and use rquickjs’s own
#[class] / #[methods] proc macros to generate the JS FFI. Each wrapper
is a thin delegation to the core type.
§Drift-detection
Because wrappers are hand-authored, new core methods are invisible until
a wrapper is added. The audit tests (see tests/audit.rs) enumerate
every pub method on the wrapped core types at build time and assert
each has a corresponding wrapper (or is explicitly marked #[skip]).
§Error mapping
ferridriver::FerriError is converted to rquickjs::Error at every
binding boundary via convert::to_rq_error. The resulting JS exception
carries the error message and, where applicable, a name matching
Playwright’s convention (TimeoutError, TargetClosedError).
Re-exports§
pub use artifacts::ArtifactsJs;pub use bdd::CollectedAllow;pub use bdd::CollectedRegistry;pub use bdd::CollectedTool;pub use bdd::HookArg;pub use bdd::JsArg;pub use bdd::ScenarioWorld;pub use bdd::ScriptAttachment;pub use bdd::StepOutcome;pub use bdd::collect_registry;pub use bdd::drain_attachments;pub use bdd::install_bdd;pub use bdd::invoke_hook;pub use bdd::invoke_step;pub use bdd::reset_world;pub use bdd::set_scenario_world;pub use bdd::tools_len;pub use bdd::tools_snapshot;pub use browser::BrowserJs;pub use browser_type::BrowserTypeJs;pub use browser_type::install_browser_type;pub use console_message::ConsoleMessageJs;pub use context::BrowserContextJs;pub use dialog::DialogJs;pub use download::DownloadJs;pub use element_handle::ElementHandleJs;pub use file_chooser::FileChooserJs;pub use frame::FrameJs;pub use frame_locator::FrameLocatorJs;pub use http_client::HttpClientJs;pub use http_client::HttpResponseJs;pub use js_handle::JSHandleJs;pub use keyboard::KeyboardJs;pub use locator::LocatorJs;pub use mouse::MouseJs;pub use network::RequestJs;pub use network::ResponseJs;pub use network::RouteJs;pub use network::WebSocketJs;pub use page::PageJs;pub use plugins::PluginBinding;pub use plugins::PluginCommandsJs;pub use plugins::install_plugins;pub use video::VideoJs;pub use web_error::WebErrorJs;
Modules§
- abort
- WHATWG
AbortController/AbortSignal(spec subset, no external deps). Enough of the standard forfetch(..., { signal }),AbortSignal.timeout(ms),AbortSignal.any([...]),onabort,addEventListener('abort', ...),.aborted,.reason,.throwIfAborted(). - artifacts
ArtifactsJs: wrapper that gives scripts a dedicated write-scoped directory for outputs like screenshots, PDFs, traces, downloaded bodies.- bdd
- Cucumber step-definition surface for the shared QuickJS engine.
- blob
- WHATWG
Blob(spec subset, no deps; semantics studied from the read-only llrt reference).new Blob(parts?, { type? })where parts is an iterable of string /Blob/Uint8Array/ArrayBuffer;size,type,text(),arrayBuffer(),bytes(),slice(),stream()(aReadableStream). Body readers are returned synchronously (await-transparent), consistent with the rest of the fetch subset. - browser
BrowserJs: JS wrapper aroundferridriver::Browser.- browser_
type BrowserTypeJs: JS wrapper aroundferridriver::BrowserType.- console_
message ConsoleMessageJs— QuickJS binding forferridriver::console_message::ConsoleMessage.- context
BrowserContextJs: JS wrapper aroundferridriver::context::ContextRef.- convert
- Conversion helpers between ferridriver core types and
rquickjsvalues. - dialog
DialogJs— QuickJS binding forferridriver::dialog::Dialog.- download
DownloadJs— QuickJS binding forferridriver::download::Download.- element_
handle ElementHandleJs: QuickJS wrapper aroundferridriver::ElementHandle.- expect
- QuickJS bindings for the
expectAPI — Jest-style value matchers, Playwright web-first matchers, asymmetric matchers, and polling. - fetch
- A WHATWG-ish
fetch+Headers+Response, so npm packages that expectfetchwork. It is a thin surface over the SAMEferridriver::http_clientcore the Playwright-stylerequestbinding uses — one HTTP stack, one place the net policy applies. The ergonomicrequestAPI stays; this just adds the standard entry point. - file_
chooser FileChooserJs— QuickJS binding forferridriver::file_chooser::FileChooser.- form_
data - WHATWG
FormData(spec subset, no deps; multipart serialization studied from the read-only llrt reference).append/set/get/getAll/has/delete/keys/values/entries/forEach; string orBlob/File-ish values.entries/keys/valuesreturn arrays (iterable:for..of fd.entries(), spread,Array.from,forEach);[Symbol.iterator]is the entries array.fetchwith aFormDatabody serializesmultipart/form-datain-binding (no core change). - frame
FrameJs: JS wrapper aroundferridriver::Frame.- frame_
locator FrameLocatorJs– QuickJS wrapper forferridriver::locator::FrameLocator.- http_
client HttpClientJs+HttpResponseJs: JS wrappers for HTTP calls from the runner side (separate from the page’s own network).- js_
handle JSHandleJs: QuickJS wrapper aroundferridriver::JSHandle.- keyboard
KeyboardJs: wrapper aroundferridriver::Page::keyboard().- locator
LocatorJs: JS wrapper aroundferridriver::locator::Locator.- mouse
MouseJs: wrapper aroundferridriver::Page::mouse().- network
- QuickJS bindings for
ferridriver::network::{Request, Response, WebSocket}. - page
PageJs: JS wrapper aroundferridriver::Page.- plugins
- Native plugin surface.
- process
- A deliberately small, sandbox-safe
processglobal. - streams
- WHATWG
ReadableStream— a deliberately small spec subset (the full llrt/stream-web machinery — BYOB, byte controllers, tee — is studied for behaviour only, not ported). - video
VideoJs— QuickJS binding forferridriver::Video.- web_
error WebErrorJs— QuickJS binding forferridriver::web_error::WebError.- webapi
- Native web-platform globals:
TextEncoder/TextDecoder/URLplusqueueMicrotask/btoa/atob.
Functions§
- define_
classes - Register every class prototype scripts can encounter so rquickjs knows how
to build instances when a method returns one (e.g.
HttpResponsefromrequest.get()orLocatorfrompage.locator()). - install_
artifacts - Install the
artifactsglobal — a dedicated sandboxed directory for script outputs (screenshots, PDFs, traces, downloaded bodies). - install_
browser - Install the
browserglobal — exposesbrowser.newContext(options?)so scripts can construct fresh contexts with the full Playwrightferridriver::options::BrowserContextOptionsbag. Rule-9 tests for §4.1 consume this entry point. - install_
browser_ context - Install the
contextglobal (cookies, storage, permissions, route, etc.). - install_
browser_ context_ on contextbinding onto an arbitrary target (seeinstall_page_on).- install_
browser_ on browserbinding onto an arbitrary target (seeinstall_page_on).- install_
page - Install the
pageglobal when a page is available on the run context. - install_
page_ on - Install the
pagebinding onto an arbitrary target object. - install_
request - Install the
requestglobal (runner-side HTTP via HttpClient). - install_
request_ on requestbinding onto an arbitrary target (seeinstall_page_on).