sjehuda / Proxy Redirect

Greetings!

I am attempting to remove the event listener once it is called.

document.addEventListener("DOMContentLoaded", function() {
  document.body.addEventListener("mouseover", async function(e) {
    if (e.target && e.target.nodeName == "A") {
      hyperLink = e.target;

      // Attempts to remove event listener
      // /questions/4386300/javascript-dom-how-to-remove-all-event-listeners-of-a-dom-object

      //hyperLink.removeEventListener('mouseover', addEventListenerToHyperlinks);
      //hyperLink.replaceWith(hyperLink.cloneNode(true));
      //let clone = hyperLink.cloneNode(true);
      //hyperLink.replaceWith(clone);

      await xhrHyperLink(hyperLink);
    }
  });
});

Whoever sees this, please consider helping.

Issue has been solved!

      for (linkElement of document.links) {
        linkElement.addEventListener("mouseover",
          async function(e) {
            if (e.target && e.target.nodeName == "A") {
              hyperLink = e.target;
              await xhrHyperLink(hyperLink);
            }
          },
          {
            once: true
          }
        );
      }

Thank you hacker09 and Konf!