diff --git a/docs/src/downloads.md b/docs/src/downloads.md index d9cd353019..952305cb25 100644 --- a/docs/src/downloads.md +++ b/docs/src/downloads.md @@ -30,6 +30,16 @@ const [ download ] = await Promise.all([ const path = await download.path(); ``` +```java +// Wait for the download to start +Download download = page.waitForDownload(() -> { + // Perform the action that initiates download + page.click("button#delayed-download"); +}); +// Wait for the download process to complete +Path path = download.path(); +``` + ```python async # Start waiting for the download async with page.expect_download() as download_info: