MDN wants to learn about developers like you:

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.


Defines options for what to do if the name of a downloaded file conflicts with an existing file.
Defines a set of possible reasons why a download was interrupted.
Defines a set of common warnings of possible dangers associated with downloadable files.
Defines different states that a current download can be in.
Represents a downloaded file.
Represents the difference between two strings.
Represents the difference between two doubles.
Represents the difference between two booleans.
Represents the time a download took to complete.
Defines a set of parameters that can be used to search the downloads manager for a specific set of downloads.

Downloads a file, given its URL and other optional preferences.
Queries the DownloadItems available in the browser's downloads manager, and returns those that match the specified search criteria.
Pauses a download.
Resumes a paused download.
Cancels a download.
Retrieves an icon for the specified download.
Opens the downloaded file with its associated application.
Opens the platform's file manager application to show the downloaded file in its containing folder.
Opens the platform's file manager application to show the default downloads folder.
Erases matching DownloadItems from the browser's download history, without deleting the downloaded files from disk.
Removes a downloaded file from disk, but not from the browser's download history.
Prompts the user to accept or cancel a dangerous download.
Initiates dragging the downloaded file to another application.
Enables or disables the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it.


Fires with the DownloadItem object when a download begins.
Fires with the downloadId when a download is erased from history.
When any of a DownloadItem's properties except bytesReceived changes, this event fires with the downloadId and an object containing the properties that changed.

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
BooleanDelta Yes No4748 Yes
DangerType Yes No4748 Yes
DoubleDelta Yes No4748 Yes
DownloadQuery Yes No4748 Yes
DownloadTime Yes No4748 Yes
FilenameConflictAction Yes No4748 Yes
InterruptReason Yes No4748 Yes
State Yes No4748 Yes
StringDelta Yes No4748 Yes
acceptDanger Yes No No No Yes
cancel Yes No4848 Yes
download Yes No4748 Yes
drag Yes No No No Yes
erase Yes No4848 Yes
getFileIcon Yes No48 No Yes
onChanged Yes No4748 Yes
onCreated Yes No4848 Yes
onErased Yes No4848 Yes
open Yes No4848 Yes
pause Yes No4848 Yes
removeFile Yes No4848 Yes
resume Yes No4848 Yes
search Yes No4748 Yes
setShelfEnabled Yes No No No Yes
show Yes No4848 Yes
showDefaultFolder Yes No4848 Yes

Example extensions


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.

Document Tags and Contributors

 Contributors to this page: wbamberg, andrewtruongmoz, chrisdavidmills
 Last updated by: wbamberg,