app/scripts/contentscript.js
/**
 * Checks if the current domain is blacklisted
 *
 * @returns {boolean} {@code true} if the current domain is blacklisted
 */
Checks if the current domain is blacklisted
@returns {boolean}  true if the current domain is blacklisted
Checks if the current domain is blacklisted @returns { boolean } true if the current domain is blacklisted
function blacklistedDomainCheck () {
  const blacklistedDomains = [
    'uscourts.gov',
    'dropbox.com',
    'webbyawards.com',
    'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html',
    'adyen.com',
    'gravityforms.com',
    'harbourair.com',
    'ani.gamer.com.tw',
    'blueskybooking.com',
  ]
  const currentUrl = window.location.href
  let currentRegex
  for (let i = 0; i < blacklistedDomains.length; i++) {
    const blacklistedDomain = blacklistedDomains[i].replace('.', '\\.')
    currentRegex = new RegExp(`(?:https?:\\/\\/)(?:(?!${blacklistedDomain}).)*$`)
    if (!currentRegex.test(currentUrl)) {
      return true
    }
  }
  return false
}
function blacklistedDomainCheck ( ) { const blacklistedDomains = [ 'uscourts.gov' , 'dropbox.com' , 'webbyawards.com' , 'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html' , 'adyen.com' , 'gravityforms.com' , 'harbourair.com' , 'ani.gamer.com.tw' , 'blueskybooking.com' , ] const currentUrl = window . location . href let currentRegex for ( let i = 0 ; i < blacklistedDomains . length ; i ++ ) { const blacklistedDomain = blacklistedDomains [ i ] . replace ( '.' , '\\.' ) currentRegex = new RegExp ( ` \\ \\ ${ blacklistedDomain } ` ) if ( ! currentRegex . test ( currentUrl ) ) { return true } } return false }
Checks if the current domain is blacklisted
 @returns {boolean} {@code true} if the current domain is blacklisted
Checks if the current domain is blacklisted @returns { boolean } { @code true } if the current domain is blacklisted