downloads.showDefaultFolder()
The showDefaultFolder()
function of the downloads
API opens the default downloads folder in the platform's file manager.
Syntax
js
browser.downloads.showDefaultFolder();
Parameters
None.
Browser compatibility
BCD tables only load in the browser
Examples
The following snippet contains a show button, which when clicked invokes showDefaultFolder()
to open the default downloads folder in the platform's file manager:
js
let showBtn = document.querySelector('.show');
showBtn.onclick = () => {
browser.downloads.showDefaultFolder();
}
Note: This API is based on Chromium's chrome.downloads
API.