Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/downloads/setshelfenabled/index.md
6581 views
---
title: downloads.setShelfEnabled() slug: Mozilla/Add-ons/WebExtensions/API/downloads/setShelfEnabled page-type: webextension-api-function tags: - API - Add-ons - Extensions - Method - Non-standard - Reference - WebExtensions - downloads - setShelfEnabled browser-compat: webextensions.api.downloads.setShelfEnabled
---

{{AddonSidebar()}}

The setShelfEnabled() function of the {{WebExtAPIRef("downloads")}} API enables or disables 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.

If you try to enable the shelf when at least one other extension has already disabled it, the call will fail and {{WebExtAPIRef("runtime.lastError")}} will be set with an appropriate error message.

Note: To use this function in your extension you must ask for the "downloads.shelf" manifest permission, as well as the "downloads" permission.

Syntax

chrome.downloads.setShelfEnabled(enabled);

This API is also available as browser.downloads.setShelfEnabled().

Parameters

  • enabled

    • : A boolean representing the state that you want to set setShelfEnabled() to — true for enable, and false for disable.

Browser compatibility

{{Compat}}

{{WebExtExamples}}

Note: This API is based on Chromium's chrome.downloads API.