A browser download's metadata and underlying artifact.
Obtain a handle with PlaywrightEx.Page.await_download/1 or from_event/2.
The browser provides suggested_filename and url when downloading starts.
save_as/3 waits for completion and preserves the source artifact. Closing
the browser context deletes the source; saved copies belong to the caller.
Summary
Functions
Explicitly deletes the source download artifact. Saved copies are unaffected.
Builds a download handle from a raw :download event without reading its file.
Saves the completed download to path, preserving its source artifact.
Types
@type event_opt() :: {:connection, GenServer.name()}
@type opt() :: {:timeout, timeout()}
@type t() :: %PlaywrightEx.Download{ artifact_guid: PlaywrightEx.guid(), connection: GenServer.name(), page_id: PlaywrightEx.guid(), suggested_filename: String.t(), url: String.t() }
Functions
@spec delete(t(), [opt() | PlaywrightEx.unknown_opt()]) :: {:ok, any()} | {:error, any()}
Explicitly deletes the source download artifact. Saved copies are unaffected.
Options
:timeout(timeout/0) - Required. Operation timeout in milliseconds.0means no waiting;:infinitydisables the timeout.
Builds a download handle from a raw :download event without reading its file.
Pass the recorder's connection when using a non-default connection.
Options
:connection(term/0) - The Connection process name. Defaults toPlaywrightEx.Supervisor.Connection. The default value isPlaywrightEx.Supervisor.Connection.
@spec save_as(t(), Path.t(), [opt() | PlaywrightEx.unknown_opt()]) :: :ok | {:error, any()}
Saves the completed download to path, preserving its source artifact.
Uses the handle's connection and applies the timeout to the whole transfer.
The caller owns the saved file. See PlaywrightEx.Artifact.save_as/3 for details.
Options
:timeout(timeout/0) - Required. Operation timeout in milliseconds.0means no waiting;:infinitydisables the timeout.