获取并搜索悬停的 link URL "only"

Get and search for the hovered link URL "only"

如标题所示

「获取并搜索悬停的link URL"仅""

实现此目标需要进行哪些更正?

// Pattern1⃣ Malfunction
// ① Opens all URLs that contain the specified word, regardless of mouse over target.
// ② Opens with or without mouseover.
var ele = document.querySelectorAll(".centerarticle-entry-title a");
var link = ['Loading...', 'Dance Party'];
var L = window.onload = function(load) {
    window.addEventListener('keydown', (e) => {
        if (e.ctrlKey && e.keyCode === 13) { // CTRL + ENTER
            for (let i = 0; i < ele.length; i++) {
                for (let j = 0; j < link.length; j++) {
                    if (!link.onmouseenter) {
                        e.stopPropagation();
                    }
                    if (ele[i].innerHTML.match(link[j])) {
                        ele[i].innerHTML.match(link[j]).onmouseenter = window.open("https://web.archive.org/web/" + ele[i].href);
                        L = undefined;
                        ele[i].onmouseenter = undefined;
                        ele[i].onmouseenter = null;
                    }
                }
            }
        } else {
            ele[i].onmouseleave = e.preventDefault();
            return false;
        }
    });
};

以Pattern1⃣为例,这从另一个意义上来说,实用方便,但是我们这次要实现的功能与Pattern1⃣不同。

您要实现的功能是 「 获取并搜索悬停的 link URL "仅" ” 我是有讲究的。

我也做了几个其他的原型,但是更不实用,因为模式1⃣的版本更差,或者搜索结果是空的

// Pattern2⃣ Malfunction
// ① Opens all URLs that contain the specified word, regardless of mouse over target.
// ② There is a 'case' that opens even if you don't mouse over.
// ③ In some cases, nothing responds in the first place, in which case you need to do a super reload etc. each time.
// ④ The number of times you pressed the ENTER key to the sky may have accumulated. Alternatively, the number of hovering times can be accumulated as it is. That possibility can open duplicate TABs unnecessarily.
var ele = document.querySelectorAll(".centerarticle-entry-title a");
var link = ['Loading...', 'Dance Party'];
document.addEventListener('mouseenter', (m_enter) => {
    document.addEventListener('mouseleave', (m_leave) => {
        m_enter.preventDefault();
        e.preventDefault();
        return false;
    });
    window.addEventListener('keydown', (e) => {
        if (!(e.ctrlKey && e.keyCode == 13)) {
            m_enter.preventDefault();
            return false;
        }
        if (e.ctrlKey && e.keyCode == 13) {
            for (let i = 0; i < ele.length; i++) {
                for (let j = 0; j < link.length; j++) {
                    if (ele.innerHTML.match(link[j])) {
                        link[j].onmouseover = window.open("https://web.archive.org/web/" + ele[i].href);
                        location.reload();
                        break;
                    }
                }
            }
        } else {
            return false;
        }
    });
});


// Pattern3⃣ Malfunction
// ① Opens only one (probably top) URL that contains the specified word, regardless of whether you hover your mouse over the target.
// ② Opens with or without mouseover.
var ele = document.querySelectorAll(".centerarticle-entry-title a");
var link = ['Loading...', 'Dance Party'];
window.addEventListener('keydown', (e) => {
    if (e.ctrlKey && e.keyCode === 13) { // CTRL + ENTER key
        for (let i = 0; i < ele.length; i++) {
            for (let j = 0; j < link.length; j++) {
                if (ele[i].innerHTML.match(link[j])) {
                    link[j].onmouseover = window.open(("https://web.archive.org/web/" + ele[i].href));
                    return false;
                }
            }
        }
    }
});


// Pattern4⃣ Malfunction
// ① Opens with or without mouseover.
// ② Search results are empty or "undefined"
var ele = document.querySelectorAll(":hover");
var link = ['Loading...', 'Dance Party'];
window.addEventListener('keydown', (e) => {
    if (e.ctrlKey && e.keyCode == 13) {
        link.onmouseenter =
            window.open("https://web.archive.org/web/" + this.href);
        return false;
    }
});

实际实验目标页面如下。

https://b.hatena.ne.jp/search/tag?q=bookmarklet&page=67

请告诉我,

<a href="https://google.com">Google</a>
<a href="https://yahoo.com">Yahoo</a>
<script>
document.onkeydown = () => {
  const link = document.querySelector('a:hover')
  if (link) window.open(link.href)
}
</script>