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

When I executed chrome.downloads.download, it downloads the file and popups up the download bar at the

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){
    // ...
  }
);

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){
    // ...
  }
);
Share Improve this question edited Feb 27, 2015 at 9:38 Xan 77.7k18 gold badges197 silver badges217 bronze badges asked Feb 26, 2015 at 20:36 Samuel ElrodSamuel Elrod 3371 gold badge3 silver badges13 bronze badges 3
  • 6 I hope to God not... (as an end-user) – Brad Christie Commented Feb 26, 2015 at 20:38
  • no, downloads go to downloads, that's what the tool is for. – dandavis Commented Feb 26, 2015 at 20:42
  • 2 Downloads can go to downloads, we just don't want the pixel space taken up at the bottom because of it, in some situations. – Vasily Hall Commented Dec 9, 2018 at 21:27
Add a ment  | 

1 Answer 1

Reset to default 10

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744411864a4572917.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信