Enables extensions to interact with the browser's download manager. You can use this API module to download files, cancel, pause, resume downloads, and show downloaded files in the file manager.
To use this API you need to have the "downloads" API permission specified in your manifest.json file.
downloads.FilenameConflictAction
downloads.InterruptReason
downloads.DangerType
downloads.State
downloads.DownloadItem
downloads.StringDelta
downloads.DoubleDelta
downloads.BooleanDelta
downloads.DownloadTime
downloads.DownloadQuery
downloads.download()
downloads.search()
DownloadItems
available in the browser's downloads manager, and returns those that match the specified search criteria.downloads.pause()
downloads.resume()
downloads.cancel()
downloads.getFileIcon()
downloads.open()
downloads.show()
downloads.showDefaultFolder()
downloads.erase()
DownloadItems
from the browser's download history, without deleting the downloaded files from disk.downloads.removeFile()
downloads.acceptDanger()
downloads.drag()
downloads.setShelfEnabled()
downloads.onCreated
DownloadItem
object when a download begins.downloads.onErased
downloadId
when a download is erased from history.downloads.onChanged
DownloadItem
's properties except bytesReceived
changes, this event fires with the downloadId
and an object containing the properties that changed.Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
BooleanDelta |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
DangerType |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
DoubleDelta |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
DownloadQuery |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
DownloadTime |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
FilenameConflictAction |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
InterruptReason |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
State |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
StringDelta |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
acceptDanger |
Yes |
79 |
No |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
cancel |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
download |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
drag |
Yes |
79 |
No |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
erase |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
getFileIcon |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onChanged |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
onCreated |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
onErased |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
open |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
pause |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
removeFile |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
resume |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
search |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
setShelfEnabled |
Yes |
79 |
No |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
show |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
showDefaultFolder |
Yes |
79 |
48 |
? |
Yes |
No |
? |
? |
48-79 |
? |
? |
? |
Note: This API is based on Chromium's chrome.downloads
API.
Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads