src/content.js
/**
 * Loops the matches for how to show the resulting match or matches.
 * @param {Array} matchHolder - Array with arrays holding the matches.
 */
Loops the matches for how to show the resulting match or matches.
@param {Array} matchHolder - Array with arrays holding the matches.
Loops the matches for how to show the resulting match or matches . @param { Array } matchHolder - Array with arrays holding the matches .
function handelMatches (matchHolder) {
  if (!ignoreDomain.includes(tabDomainName)) {
    console.log('Content: match holder info used', matchHolder)
    let text
    if (matchHolder.length > 1) {
      text = tabDomainName + ' har flere tilbud igennem ' + matchHolder[0][4]
      for (let i = 0; i < matchHolder.length - 1; i++) {
        if (matchHolder[i][4] !== matchHolder[i + 1][4]) {
          text = tabDomainName + ' har tilbud igennem flere udbydere'
          break
        }
      }
    } else {
      const shop = matchHolder[0][1]
      const discount = matchHolder[0][2]
      const link = matchHolder[0][3] 
      const service = '<a href="' + link + '"><font style="">' + matchHolder[0][4] + '</font></a>'
      text = shop + ' har ' + discount + ' igennem ' + service
    }
    makeTopPane(text)
  }
}
function handelMatches ( matchHolder ) { if ( ! ignoreDomain . includes ( tabDomainName ) ) { console . log ( 'Content: match holder info used' , matchHolder ) let text if ( matchHolder . length > 1 ) { text = tabDomainName + ' har flere tilbud igennem ' + matchHolder [ 0 ] [ 4 ] for ( let i = 0 ; i < matchHolder . length - 1 ; i ++ ) { if ( matchHolder [ i ] [ 4 ] !== matchHolder [ i + 1 ] [ 4 ] ) { text = tabDomainName + ' har tilbud igennem flere udbydere' break } } } else { const shop = matchHolder [ 0 ] [ 1 ] const discount = matchHolder [ 0 ] [ 2 ] const link = matchHolder [ 0 ] [ 3 ] const service = '<a href="' + link + '"><font style="">' + matchHolder [ 0 ] [ 4 ] + '</font></a>' text = shop + ' har ' + discount + ' igennem ' + service } makeTopPane ( text ) } }
Loops the matches for how to show the resulting match or matches.
Loops the matches for how to show the resulting match or matches .
// Look if more then one service has discount on the page
 // Link for popup
