popup/popup.js
// Display all visible links in the popup
Display all visible links in the popup
Display all visible links in the popup
function showLinks() {
  var linksTable = document.getElementById('links');
  while (linksTable.children.length > 1) {
    linksTable.removeChild(linksTable.children[linksTable.children.length - 1])
  }
  for (var i = 0; i < visibleLinks.length; ++i) {
    var row = document.createElement('tr');
    var col0 = document.createElement('td');
    var col1 = document.createElement('td');
    var checkbox = document.createElement('input');
    checkbox.checked = true;
    checkbox.type = 'checkbox';
    checkbox.id = 'check' + i;
    col0.appendChild(checkbox);
    linksTextArray = visibleLinks[i].split("/");
    col1.innerText = linksTextArray[linksTextArray.length - 1];
    col1.style.whiteSpace = 'nowrap';
    col1.onclick = function() {
      checkbox.checked = !checkbox.checked;
    }
    row.appendChild(col0);
    row.appendChild(col1);
    linksTable.appendChild(row);
  }
}
function showLinks ( ) { var linksTable = document . getElementById ( 'links' ) ; while ( linksTable . children . length > 1 ) { linksTable . removeChild ( linksTable . children [ linksTable . children . length - 1 ] ) } for ( var i = 0 ; i < visibleLinks . length ; ++ i ) { var row = document . createElement ( 'tr' ) ; var col0 = document . createElement ( 'td' ) ; var col1 = document . createElement ( 'td' ) ; var checkbox = document . createElement ( 'input' ) ; checkbox . checked = true ; checkbox . type = 'checkbox' ; checkbox . id = 'check' + i ; col0 . appendChild ( checkbox ) ; linksTextArray = visibleLinks [ i ] . split ( "/" ) ; col1 . innerText = linksTextArray [ linksTextArray . length - 1 ] ; col1 . style . whiteSpace = 'nowrap' ; col1 . onclick = function ( ) { checkbox . checked = ! checkbox . checked ; } row . appendChild ( col0 ) ; row . appendChild ( col1 ) ; linksTable . appendChild ( row ) ; } }
Display all visible links in the popup
Display all visible links in the popup