Commit 9427c3c8 authored by edwin's avatar edwin

remove get idarray on download listener

parent 00e12d50
...@@ -32,7 +32,7 @@ chrome.extension.onMessage.addListener(function(request,sender,sendResponse){ ...@@ -32,7 +32,7 @@ chrome.extension.onMessage.addListener(function(request,sender,sendResponse){
} }
console.log("Current index : ", index); console.log("Current index : ", index);
console.log("Current noImages : " , noImages); console.log("Current noImages : " , noImages);
if(index >= skus.length-1) { if(index >= skus.length) {
console.log("Last file was downloaded"); console.log("Last file was downloaded");
alert(noImages); alert(noImages);
} }
...@@ -40,16 +40,16 @@ chrome.extension.onMessage.addListener(function(request,sender,sendResponse){ ...@@ -40,16 +40,16 @@ chrome.extension.onMessage.addListener(function(request,sender,sendResponse){
chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) { chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) {
if(!skus.length){ // if(!skus.length){
chrome.storage.local.get('idArray', function (items) { // chrome.storage.local.get('idArray', function (items) {
skus = items.idArray.split(','); // skus = items.idArray.split(',');
}); // });
} // }
var new_filename = skus[index] + ".zip"; var new_filename = skus[index] + ".zip";
suggest({filename: new_filename}); suggest({filename: new_filename});
index++; index++;
if(index >= skus.length-1) { if(index >= skus.length) {
console.log("Last file was downloaded"); console.log("Last file was downloaded");
alert(noImages); alert(noImages);
} }
......
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