Expand description
JS dialog (alert/confirm/prompt/beforeunload) and page-initiated
download capture via WebDriver BiDi browsingContext.* events.
Firefox surfaces user prompts and downloads as local BiDi events. This module
records them into a shared, cheaply-cloneable DialogLog (mirroring
crate::network::NetworkLog) so the agent can:
- Confirm alert-based XSS: the
alert()message is captured fromuserPromptOpenedeven when the prompt is auto-handled, so a payload that popsalert(document.domain)is proven fired without the automation hanging on the modal. - Read
confirm/prompttext and answer them viacrate::Page::handle_user_prompt(when launched with theignoreprompt-handler so the prompt stays open). - Inspect page-initiated downloads: suggested filename (path-traversal / exfil probes) and source URL (without a file landing on disk).
The log never blocks the browser: under the BiDi default prompt handler
(dismiss and notify) the events still fire, so recording is side-effect
free. Auto-handling policy lives one layer up (the bridge), keeping this a
pure observation primitive.
Structs§
- Captured
Dialog - One captured JS user prompt.
- Captured
Download - One page-initiated download.
- Dialog
Log - Shared, cloneable handle to the dialog + download capture buffer.
Constants§
- DIALOG_
EVENTS - BiDi event identifiers this module subscribes to.
Functions§
- make_
dialog_ handler - Build the event handler that feeds
browsingContext.*dialog and download events intolog. Mirrorscrate::network::make_network_handler.