Skip to content

Commit

Permalink
efficient selectedOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hpat0003 committed Oct 7, 2018
1 parent 1a9b81d commit 02792ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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(() => {
Expand Down

0 comments on commit 02792ec

Please sign in to comment.