ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Page.setDownloadBehaviour deprecated #242

Closed roshansourav closed 3 years ago

roshansourav commented 3 years ago

Since this https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-setDownloadBehavior is deprecated. So, what is alternative solution.? I am trying to download a file using puppeteer in nodejs.

pbi-qfs commented 3 years ago

https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setDownloadBehavior

roshansourav commented 3 years ago

Hey @pbi-qfs . Thanks man. Its is working super fine without any error. BUT, i am facing 1 more problem here. That file is being downloaded but it is not being saved in the current folder. I am using parameter { behavior: 'allow', downloadPath: './' } . Is there anything which needs to be changed?

pbi-qfs commented 3 years ago

I would guess that the value of "current folder" might be different from the client's and from Chrome's perspective. To be on the save side, specify the path absolutely, e.g. '/tmp/'.

roshansourav commented 3 years ago

Yes, this worked for me. Thank you so much @pbi-qfs . Thanks Man.