src/popup.js
/**
 * Transform popup item into a link. Must move all items inside a new <a> element
 * @param {Array} children - Array of html objects to move.
 * @param {Object} newEntry - HTML object for the popup item.
 * @param {String} inLink - String to use as the actual link.
 */
Transform popup item into a link. Must move all items inside a new  element
@param {Array} children - Array of html objects to move.
@param {Object} newEntry - HTML object for the popup item.
@param {String} inLink - String to use as the actual link.
Transform popup item into a link . Must move all items inside a new element @param { Array } children - Array of html objects to move . @param { Object } newEntry - HTML object for the popup item . @param { String } inLink - String to use as the actual link .
function makeLink (children, newEntry, inLink) {
  const newA = document.createElement('a')
  for (const child of children) {
    if (child) { newA.appendChild(child) }
  }
  newEntry.appendChild(newA)
  newA.classList.add('nounderline')
  newA.setAttribute('href', inLink)
  newA.setAttribute('listTitle', 'Open link')
  newEntry.classList.add('is-link')
  newEntry.addEventListener('mouseup', function (e) {
    if (e.which === 1) {
      chrome.tabs.update({ url: inLink })
    }
  })
}
function makeLink ( children , newEntry , inLink ) { const newA = document . createElement ( 'a' ) for ( const child of children ) { if ( child ) { newA . appendChild ( child ) } } newEntry . appendChild ( newA ) newA . classList . add ( 'nounderline' ) newA . setAttribute ( 'href' , inLink ) newA . setAttribute ( 'listTitle' , 'Open link' ) newEntry . classList . add ( 'is-link' ) newEntry . addEventListener ( 'mouseup' , function ( e ) { if ( e . which === 1 ) { chrome . tabs . update ( { url : inLink } ) } } ) }
Transform popup item into a link.
Transform popup item into a link .
// Transforms list object to a link
 // Append all underlying elements to new link object
 // Add lister to redirect tab page on click in popup window
 // Only update url if left mouse button is pressed. This means that middle click
 // will open the url in a new tab, and not do a url update on the current tab
