-
Notifications
You must be signed in to change notification settings - Fork 54
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
File download? #85
Comments
Yes it's planned but I do not have any estimates yet. Lets keep the bug open. |
https://github.com/rusq/chromedl for an example |
I second this. If I find time, I might look at how hard it would be to add. |
Agreed. I will take a look. WRP fell behind on development a little bit. I need to get back to this. |
I try to give it a look and understand how it all works and where some code should be added to handle a download file scenario. This is kind of hard because there is no easy way for WRP to know a file should be downloaded as a response for the user interaction. The way I though we have to detect if a download have been initiated by some user interaction is to hook up the proper events from chromedp and use them to create and destroy a "chan" object to block. So, I tried adding the following code inside "action" function: Inside the IF block for mouse clicks: if w.mouseX > 0 && w.mouseY > 0 { I added the code to detect file download has completed, could add another for WillBeginDownload I guess: chromedp.ListenTarget(ctx, func(v interface{}) { Also added this code right below this to enable file downloads:
And the after this the call to MouseClickXY is made. But the download doesn't never occurs, and don't know what I'm doing wrong (I have another project with this code and the download does happen). One additional thing, I had to update the chromedp reference to a newer version (0.85) to support these newer sample code. Any thoughs? Agv |
Some files will also specify that they should be downloaded in the headers, so that needs to be checked for too. |
I will take a look. To be honest update of chromedp to newer version stopped me from doing any recent updates to wrp. I have started updating but never finished as too many things broke. Let me see if I can retry the process. |
There is some interesting discussion going on here: chromedp/chromedp#388 with an example here https://github.com/chromedp/examples/blob/master/download_file/main.go - so maybe? |
Awesome project! Can’t wait to try it on my Amiga!
Is support for file download planned?
The text was updated successfully, but these errors were encountered: