all "Save as …" dialogs for files after the first now appear at once,
This commit is contained in:
parent
e330d7b02c
commit
4b036b5d8f
@ -31,22 +31,17 @@ async function downloadAllFiles(urlsAndFilenames) {
|
|||||||
console.log(`background.js: downloadAllFiles(): started with ${JSON.stringify(urlsAndFilenames)}`);
|
console.log(`background.js: downloadAllFiles(): started with ${JSON.stringify(urlsAndFilenames)}`);
|
||||||
const currentDate = getCurrentDate();
|
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++) {
|
for (let i = 0; i < urlsAndFilenames.length; i++) {
|
||||||
// prefix filename
|
// prefix filename
|
||||||
let prefixedFilename = currentDate + " " + urlsAndFilenames[i].filename;
|
let prefixedFilename = currentDate + " " + urlsAndFilenames[i].filename;
|
||||||
console.log(`background.js: downloadAllFiles(): i is ${i}`);
|
console.log(`background.js: downloadAllFiles(): i is ${i}`);
|
||||||
// if ( i == 0 ) {
|
if ( i == 0 ) {
|
||||||
await downloadFile(urlsAndFilenames[i].url, prefixedFilename, true).then(onSuccess, onFailure);
|
await downloadFile(urlsAndFilenames[i].url, prefixedFilename, true).then(onSuccess, onFailure);
|
||||||
// } else {
|
} else {
|
||||||
// downloadFile(urlsAndFilenames[i].url, prefixedFilename).then(onSuccess, onFailure);
|
downloadFile(urlsAndFilenames[i].url, prefixedFilename, true).then(onSuccess, onFailure);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handlePageactionClick(tab, onClickData) {
|
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
|
// add listener for the extension button
|
||||||
browser.pageAction.onClicked.addListener(handlePageactionClick);
|
browser.pageAction.onClicked.addListener(handlePageactionClick);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user