downloads.getFileIcon()

Retrieve an icon for the specified download. For new downloads, file icons are available after the downloads.onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.

Syntax

browser.downloads.getFileIcon(
  downloadId,             // integer
  options,                // optional object
  function(iconURL) {...} // function
)

Parameters

downloadId
integer. The identifier for the download.
optionsOptional
object.
sizeOptional
integer. The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32x32 pixels.
callback
function. The function is passed the following arguments:
iconURLOptional
string.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?NoYes33
Firefox
Basic supportNo

Examples

Acknowledgements

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

Document Tags and Contributors

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