all "Save as …" dialogs for files after the first now appear at once,

This commit is contained in:
eclipse 2025-09-04 17:57:45 +02:00
parent e330d7b02c
commit 4b036b5d8f

View File

@ -31,22 +31,17 @@ async function downloadAllFiles(urlsAndFilenames) {
console.log(`background.js: downloadAllFiles(): started with ${JSON.stringify(urlsAndFilenames)}`);
const currentDate = getCurrentDate();
for (const urlAndFilename of urlsAndFilenames) {
let prefixedFilename = currentDate + " " + urlAndFilename.filename;
await downloadFile(urlAndFilename.url, prefixedFilename, true).then(onSuccess, onFailure);
}
/*
for (let i = 0; i < urlsAndFilenames.length; i++) {
// prefix filename
let prefixedFilename = currentDate + " " + urlsAndFilenames[i].filename;
console.log(`background.js: downloadAllFiles(): i is ${i}`);
// if ( i == 0 ) {
if ( i == 0 ) {
await downloadFile(urlsAndFilenames[i].url, prefixedFilename, true).then(onSuccess, onFailure);
// } else {
// downloadFile(urlsAndFilenames[i].url, prefixedFilename).then(onSuccess, onFailure);
// }
} else {
downloadFile(urlsAndFilenames[i].url, prefixedFilename, true).then(onSuccess, onFailure);
}
}
*/
}
function handlePageactionClick(tab, onClickData) {
@ -86,12 +81,5 @@ function handlePageactionClick(tab, onClickData) {
)
}
/*
let gettingAllPermissions = browser.permissions.getAll();
gettingAllPermissions.then((allPermissions) => {
console.log(JSON.stringify(allPermissions))
});
*/
// add listener for the extension button
browser.pageAction.onClicked.addListener(handlePageactionClick);