Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

downloads.acceptDanger()

The acceptDanger() function of the downloads API prompts the user to either accept or cancel a potentially dangerous download.

This function can't be called from background scripts, only in scripts that are running in a visible window (such as a browser or page action's popup).

Syntax

chrome.downloads.acceptDanger(
  downloadId,      // integer
  function() {...} // optional function
)

This API is also available as browser.downloads.acceptDanger() in a version that returns a promise.

Parameters

downloadId
An integer representing the id of the DownloadItem in question.
functionOptional
An optional callback function, which when included is invoked when the acceptDanger() call completes (i.e. the user makes a decision).

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes No No No 33

Acknowledgements

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: Makyen, wbamberg, chrisdavidmills
 Last updated by: Makyen,