popup/popup.js
// Select only the pdf and doc files and return the links
Select only the pdf and doc files and return the links
Select only the pdf and doc files and return the links
function filterLinks() {
  console.log(allLinks[0]);
  for (var i =0; i < allLinks.length ; i++) {
    if ((allLinks[i].substr(allLinks[i].length - 4) == '.pdf') ||
        (allLinks[i].substr(allLinks[i].length - 4) == '.doc') ||
        (allLinks[i].substr(allLinks[i].length - 5) == '.docx')) {
          visibleLinks.push(allLinks[i]);
    }
  }
  return visibleLinks;
}
function filterLinks ( ) { console . log ( allLinks [ 0 ] ) ; for ( var i = 0 ; i < allLinks . length ; i ++ ) { if ( ( allLinks [ i ] . substr ( allLinks [ i ] . length - 4 ) == '.pdf' ) || ( allLinks [ i ] . substr ( allLinks [ i ] . length - 4 ) == '.doc' ) || ( allLinks [ i ] . substr ( allLinks [ i ] . length - 5 ) == '.docx' ) ) { visibleLinks . push ( allLinks [ i ] ) ; } } return visibleLinks ; }
Select only the pdf and doc files and return the links
Select only the pdf and doc files and return the links