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).


  downloadId,      // integer
  function() {...} // optional function

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


An integer representing the id of the DownloadItem in question.
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


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,