acceptDanger method

Future<void> acceptDanger(
  1. int downloadId
)

Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires. |downloadId|: The identifier for the DownloadItem. |callback|: Called when the danger prompt dialog closes.

Implementation

Future<void> acceptDanger(int downloadId) async {
  await promiseToFuture<void>($js.chrome.downloads.acceptDanger(downloadId));
}