Program FREELink

You have to remove/comment the following code to test this issue:

for (const link of document.querySelectorAll('a[href^="http"]')) {
  //mod = init(link);
  mod = init(link.href, link.outerText);
  if (mod) {
    link.href = mod
  }
}

The following event delegator doesn't work in some cases (see below).

// /questions/29896128/add-event-listener-on-every-link
// mouseover isn't available when only keyboard is in use
// try also infocus, focus or similar
//document.body.addEventListener("click", function(e) {
document.body.addEventListener("mouseover", function(e) { // mouseover works with keyboard too
  if (e.target && e.target.nodeName == "A") {
    mod = init(e.target.href, e.target.outerText);
    if (mod) {
      e.target.href = mod;
    }
  }
});

Hyperlinks nested inside and wrap other elements (or a single element?) are not affected.

<a href="https://www.youtube.com/watch?v=4NpS1uqTjlQ" rel="noreferrer">
<img alt="Bq-paella-installation-tutorial.jpg" src="/images/thumb/c/ce/Bq-paella-installation-tutorial.jpg/256px-Bq-paella-installation-tutorial.jpg" decoding="async" width="256" height="144" srcset="/images/thumb/c/ce/Bq-paella-installation-tutorial.jpg/384px-Bq-paella-installation-tutorial.jpg 1.5x, /images/thumb/c/ce/Bq-paella-installation-tutorial.jpg/512px-Bq-paella-installation-tutorial.jpg 2x">
</a>

From https://wiki.postmarketos.org/wiki/BQ_Aquaris_X5_(bq-paella)#Installation

<div id="downloads" class="clearfix" align="center">
 <a href="https://gh.odyssey346.dev/Tomas-M/xlunch/archive/v4.7.4.zip" id="download-zip" class="button" rel="noreferrer"><span>Download xlunch v4.7.4.zip &nbsp;&nbsp;</span></a>
 <a href="https://gothub.lunar.icu/Tomas-M/xlunch/archive/v4.7.4.tar.gz" id="download-tar-gz" class="button" rel="noreferrer"><span>Download xlunch v4.7.4.tar.gz &nbsp;&nbsp;</span></a>
 <a href="https://github.com/Tomas-M/xlunch" id="view-on-github" class="button" rel="noreferrer"><span>View on GitHub &nbsp;&nbsp;</span></a>
 </div>

From http://xlunch.org/

Please help.