downloads.DownloadItem

Represents a downloaded file.

Type

Values of this type are objects. They contain the following properties:

id
integer. An identifier that is persistent across browser sessions.
url
string. Absolute URL.
referrer
string.
filename
string. Absolute local path.
incognito
boolean. False if this download is recorded in the history, true if it is not recorded.
danger
downloads.DangerType. Indication of whether this download is thought to be safe or known to be suspicious.
mime
string. The file's MIME type.
startTime
string. Number of milliseconds between the unix epoch and when this download began.
endTimeOptional
string. Number of milliseconds between the unix epoch and when this download ended.
estimatedEndTimeOptional
string.
state
downloads.State. Indicates whether the download is progressing, interrupted, or complete.
paused
boolean. True if the download has stopped reading data from the host, but kept the connection open.
canResume
boolean.
errorOptional
downloads.InterruptReason. Number indicating why a download was interrupted.
bytesReceived
number. Number of bytes received so far from the host, without considering file compression.
totalBytes
number. Number of bytes in the whole file, without considering file compression, or -1 if unknown.
fileSize
number. Number of bytes in the whole file post-decompression, or -1 if unknown.
exists
boolean.
byExtensionIdOptional
string.
byExtensionNameOptional
string.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?47.0Yes33
Firefox
Basic support48.0

Acknowledgements

This API is based on Chromium's chrome.downloads API.

Document Tags and Contributors

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