Commit 5405186a authored by edwin's avatar edwin

update extension rename logic to prevent conflict

parent ab39065f
......@@ -49,16 +49,18 @@ chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) {
// skus = items.idArray.split(',');
// });
// }
var new_filename = skus[index] + ".zip";
suggest({filename: new_filename});
index++;
if(index >= skus.length) {
console.log("Last file was downloaded");
alert(noImages);
console.log(item.url);
if(item.url.includes("https://digitallibrary-external.fastretailing.com/api/asset")){
var new_filename = skus[index] + ".zip";
suggest({filename: new_filename});
index++;
if(index >= skus.length) {
console.log("Last file was downloaded");
alert(noImages);
index = 0;
noImages = "";
chrome.storage.local.remove('idArray');
index = 0;
noImages = "";
chrome.storage.local.remove('idArray');
}
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment