function onLoad() {
  console.log('Starter extension content script loaded on', location.href);
}

window.addEventListener('DOMContentLoaded', onLoad);

chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
  if (message?.type === 'GET_NUM_LINKS') {
    const count = document.querySelectorAll('a').length;
    sendResponse({ count });
  }
});