最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin5浏览0评论

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论