Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Downloads #853

Closed
JoelEinbinder opened this issue Feb 5, 2020 · 5 comments
Closed

[Feature] Downloads #853

JoelEinbinder opened this issue Feb 5, 2020 · 5 comments

Comments

@JoelEinbinder
Copy link
Contributor

It would be nice to have an api like:

page.on('download', async download => {
   const buffer = await download.data();
   console.log('got download', download.url(), buffer.length);
});

We can hack it with Page.setDownloadBehavior in chromium and monitoring the download folder, but it would be nicer to have something like download interception in all of the browsers.

Should the event come when the download starts, or when it finishes? I think when it starts.

Previous discussion in puppeteer: puppeteer/puppeteer#299

@JoelEinbinder
Copy link
Contributor Author

@aslushnikov what do you think?

@DavertMik
Copy link
Contributor

I love the API!
However, I am really fine with just specifying the download directory without intercepting the request on its own. If I could have a file saved in a proper directory I can open it by myself once it is written and do all manipulations there.

It would be nice to have an event like donload.complete but I'm not sure where this event should be attached... Anyway, at this moment we can just monitor directory for a file and that's enough for us!

@KevinYeramian
Copy link

KevinYeramian commented Feb 7, 2020

@joelbyford
Copy link

Believe that comment was for @JoelEinbinder instead 😄

@pavelfeldman
Copy link
Member

Download event is now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants