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) { ...@@ -49,16 +49,18 @@ chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) {
// skus = items.idArray.split(','); // skus = items.idArray.split(',');
// }); // });
// } // }
console.log(item.url);
var new_filename = skus[index] + ".zip"; if(item.url.includes("https://digitallibrary-external.fastretailing.com/api/asset")){
suggest({filename: new_filename}); var new_filename = skus[index] + ".zip";
index++; suggest({filename: new_filename});
if(index >= skus.length) { index++;
console.log("Last file was downloaded"); if(index >= skus.length) {
alert(noImages); console.log("Last file was downloaded");
alert(noImages);
index = 0; index = 0;
noImages = ""; noImages = "";
chrome.storage.local.remove('idArray'); 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