diff --git a/src/popup.js b/src/popup.js index b27f59c..e625628 100755 --- a/src/popup.js +++ b/src/popup.js @@ -136,7 +136,7 @@ function downloadResources() { let footer = document.getElementById("footer"); let button = document.getElementById("downloadResources"); let resourceSelector = document.getElementById("resourceSelector"); - let selectedOptions = Array.from(resourceSelector.options).filter(option => option.selected) + let selectedOptions = Array.from(resourceSelector.selectedOptions); // hidding the button and showing warning text button.setAttribute('hidden', 'hidden'); @@ -155,6 +155,10 @@ function downloadResources() { requestFeedback(); }, (selectedOptions.length+4)*INTERVAL); + // chrome.downloads.onDeterminingFilename.addListener(function(item, suggest) { + // suggest({filename: 'MD/' + item.filename}); + // }); + // selectedOptions.forEach(option => chrome.downloads.download({url: option.value})); selectedOptions.forEach((option, index) => { setTimeout(() => {