Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using chrome.downloads.download, is it possible to make the file not popup the download bar?

When I executed chrome.downloads.download, it downloads the file and popups up the download bar at the bottom and shows it, can I suppress it?

Example:

/* some code to suppress download bar */

chrome.downloads.download(
  { "url": request.ImageToDownload },
  function (downloadId){
    // ...
  }
);
like image 771
Samuel Elrod Avatar asked Jan 18 '26 16:01

Samuel Elrod


1 Answers

Yes, it's possible. You can fully suppress the download bar:

chrome.downloads.setShelfEnabled(boolean enabled)

Enable or disable the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it. Enabling the shelf while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.shelf" permission in addition to the "downloads" permission.

Make sure to restore it after you're done. The idea of this function is to allow you to build a custom UI that replaces the shelf.

like image 192
Xan Avatar answered Jan 21 '26 06:01

Xan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!