Skip to main content

Module bindings

Module bindings 

Source
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 for fetch(..., { 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() (a ReadableStream). Body readers are returned synchronously (await-transparent), consistent with the rest of the fetch subset.
browser
BrowserJs: JS wrapper around ferridriver::Browser.
browser_type
BrowserTypeJs: JS wrapper around ferridriver::BrowserType.
console_message
ConsoleMessageJs — QuickJS binding for ferridriver::console_message::ConsoleMessage.
context
BrowserContextJs: JS wrapper around ferridriver::context::ContextRef.
convert
Conversion helpers between ferridriver core types and rquickjs values.
dialog
DialogJs — QuickJS binding for ferridriver::dialog::Dialog.
download
DownloadJs — QuickJS binding for ferridriver::download::Download.
element_handle
ElementHandleJs: QuickJS wrapper around ferridriver::ElementHandle.
expect
QuickJS bindings for the expect API — Jest-style value matchers, Playwright web-first matchers, asymmetric matchers, and polling.
fetch
A WHATWG-ish fetch + Headers + Response, so npm packages that expect fetch work. It is a thin surface over the SAME ferridriver::http_client core the Playwright-style request binding uses — one HTTP stack, one place the net policy applies. The ergonomic request API stays; this just adds the standard entry point.
file_chooser
FileChooserJs — QuickJS binding for ferridriver::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 or Blob/File-ish values. entries/keys/values return arrays (iterable: for..of fd.entries(), spread, Array.from, forEach); [Symbol.iterator] is the entries array. fetch with a FormData body serializes multipart/form-data in-binding (no core change).
frame
FrameJs: JS wrapper around ferridriver::Frame.
frame_locator
FrameLocatorJs – QuickJS wrapper for ferridriver::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 around ferridriver::JSHandle.
keyboard
KeyboardJs: wrapper around ferridriver::Page::keyboard().
locator
LocatorJs: JS wrapper around ferridriver::locator::Locator.
mouse
MouseJs: wrapper around ferridriver::Page::mouse().
network
QuickJS bindings for ferridriver::network::{Request, Response, WebSocket}.
page
PageJs: JS wrapper around ferridriver::Page.
plugins
Native plugin surface.
process
A deliberately small, sandbox-safe process global.
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 for ferridriver::Video.
web_error
WebErrorJs — QuickJS binding for ferridriver::web_error::WebError.
webapi
Native web-platform globals: TextEncoder / TextDecoder / URL plus queueMicrotask / 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. HttpResponse from request.get() or Locator from page.locator()).
install_artifacts
Install the artifacts global — a dedicated sandboxed directory for script outputs (screenshots, PDFs, traces, downloaded bodies).
install_browser
Install the browser global — exposes browser.newContext(options?) so scripts can construct fresh contexts with the full Playwright ferridriver::options::BrowserContextOptions bag. Rule-9 tests for §4.1 consume this entry point.
install_browser_context
Install the context global (cookies, storage, permissions, route, etc.).
install_browser_context_on
context binding onto an arbitrary target (see install_page_on).
install_browser_on
browser binding onto an arbitrary target (see install_page_on).
install_page
Install the page global when a page is available on the run context.
install_page_on
Install the page binding onto an arbitrary target object.
install_request
Install the request global (runner-side HTTP via HttpClient).
install_request_on
request binding onto an arbitrary target (see install_page_on).