secret-agent
secret-agent copied to clipboard
feat: file downloads
This PR is a wip.
You can subscribe to "download" on a per-tab basis tab.on('download', download: Download => ....). Download in client has a "waitForFinished" that you can use to wait until the download is completed.
Currently, this is implemented by adding a hook into CorePlugins to a new Browser Context (ie, Incognito window).
The default plugin is currently registering the userDataDirectory/downloads as the downloads directory.
TODO:
- [ ] update docs
- [ ] fix skipped tests
- [ ] downloads broken on windows
- [x] need a mechanism to cleanup downloads?
- [x] fix broken test about new window downloads
- [x] add a test that going to a pdf triggers a download (#361)
- [x] need a way to download the file from core?
- [x] fullstack test
- [x] if a navigation turns into a download, return that as the resource
@calebjclark Any other thoughts?
Will this get implemented some day?
Will this get implemented some day?
Secret agent has mostly been retired and replaced with Hero and Unblocked. The individuals interested in this feature went away, so it never got the interest/work to be completed. There's a branch in unblocked for much of this work, but it hasn't been looked at in a while. One issue I never resolved is that I think ultimately, downloads should feel like regular resources, which requires a few changes like streaming downloads.
Are you at all interested in trying to take on completing the feature?