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
1 Answer
Reset to default 10Yes, 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.