feat: allow headers to be sent with webContents.downloadURL() (#39455)

feat: allow headers to be sent with webContents.downloadURL()
This commit is contained in:
Shelley Vohr 2023-08-17 14:17:55 +02:00 committed by GitHub
parent 31dfde7fa6
commit 00746e662b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 392 additions and 269 deletions

View file

@ -1046,9 +1046,11 @@ const win = new BrowserWindow()
win.loadFile('src/index.html')
```
#### `contents.downloadURL(url)`
#### `contents.downloadURL(url[, options])`
* `url` string
* `options` Object (optional)
* `headers` Record<string, string> (optional) - HTTP request headers.
Initiates a download of the resource at `url` without navigating. The
`will-download` event of `session` will be triggered.