popup/popup.js
// Download all visible checked links.
Download all visible checked links.
Download all visible checked links .
function downloadCheckedLinks() {
  var pending = 0;
  for (var i = 0; i < visibleLinks.length; ++i) {
    if (document.getElementById('check' + i).checked) {
      pending = pending + 1;
      chrome.downloads.download({url: visibleLinks[i]}, function(downloadId) {
        pending = pending - 1;
        if (pending <1) {
          window.close()
        }
      });
    }
  }
}
function downloadCheckedLinks ( ) { var pending = 0 ; for ( var i = 0 ; i < visibleLinks . length ; ++ i ) { if ( document . getElementById ( 'check' + i ) . checked ) { pending = pending + 1 ; chrome . downloads . download ( { url : visibleLinks [ i ] } , function ( downloadId ) { pending = pending - 1 ; if ( pending < 1 ) { window . close ( ) } } ) ; } } }
Download all visible checked links.
Download all visible checked links .