function checkAndStoreUsedOnDomain()

in src/js/other-websites/inpage_menu.js [100:119]


function checkAndStoreUsedOnDomain(domainList, currentDomain) {
  // If the used_on field is blank, then just set it to the current page/hostname. Otherwise, add/check if domain exists in the field
  if (
    domainList === null ||
    domainList === "" ||
    domainList === undefined
  ) {
    return currentDomain;
  }
 
  // Domain already exists in used_on field. Just return the list!
  if (domainList.split(",").includes(currentDomain)) {
    return domainList;
  }

  // Domain DOES NOT exist in used_on field. Add it to the domainList and put it back as a CSV string.
  // If there's already an entry, add a comma too
  domainList += domainList !== "" ? `,${currentDomain}` : currentDomain;
  return domainList;
}