Comments (4)
I understand your point, I also agree this should be part of the DownloadItem, so an electron issue.
Just for reference, may be interesting to someone, as a workaround I'm using the onBeforeSendHeaders method off the default session's webRequest. This affects all requests which falls within the filter definition. Works for my use case, but maybe does not cover all.
from electron-dl.
I don't see any API for that in Electron: https://electron.atom.io/docs/api/download-item/
So you would have to get it added to Electron first: https://github.com/electron/electron/issues
(Please comment the Electron issue here if you do)
from electron-dl.
There was an issue (electron/electron#10582) made for Electron, but it got closed becaused they considered it to be a question rather than a feature request.
One contributor in that issue said
DownloadItem is handled by the Download Manager, the only API that seems to work with the download manager is contents.downloadURL(url):
https://github.com/electron/electron/blob/master/docs/api/web-contents.md#contentsdownloadurlurlLooking at the C++ binding only a URL is allowed to be passed into the function:
electron/atom/browser/api/atom_api_web_contents.cc
Line 1061 in cc9771a
void WebContents::DownloadURL(const GURL& url) {
For allowing custom headers etc. to work an extension to the downloadURL function needs to be implemented.
from electron-dl.
Closing in favor of electron/electron#12883
from electron-dl.
Related Issues (20)
- saveAs window prompt always showing up HOT 8
- Allow to fetch the file as a buffer HOT 3
- Support relative paths HOT 1
- MULTIPLY BUG with DOWNLOAD (BIGGEST BUG 2021?) HOT 4
- Cannot find n ame 'Completed'. (new in 3.2) HOT 1
- Utilizing session.enableNetworkEmulation with ElectronDL HOT 1
- TypeError upon evaluation of download() arguments HOT 1
- how to use electron latest in electron-dl HOT 10
- Overwrite Option is flase. but, the same file name is specified in the directory, it is overwritten. HOT 2
- Status of tests and remote module HOT 1
- Downloads stuck on MacOS HOT 5
- Cannot read property 'getType' of null at getWindowFromWebContents
- cannot read 'getOwnerBrowserWindow' HOT 1
- Save-as dialog shows two periods before the SQLite file extension in the file type filter
- Property defination are different between index.d.ts and index.js
- Download URL with POST requests. HOT 1
- is there any sample project i can't make
- how can i make progress bar please help HOT 1
- When I change menu in navbar with route, it goes into loop
- how to post a json param
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-dl.