mylloon.fr/static/js/mail_obfuscation.js

18 lines
511 B
JavaScript
Raw Permalink Normal View History

2024-05-03 12:49:50 +02:00
window.addEventListener("load", () => {
Array.from(document.getElementsByClassName("at")).forEach((elem) => {
2024-06-02 18:44:57 +02:00
const a = elem.parentElement;
const span = elem.previousElementSibling;
2024-06-02 18:19:58 +02:00
// Replace (at) by @
elem.outerHTML = "@";
// Correct text
2024-06-02 18:44:57 +02:00
const data = span.getAttribute("title");
2024-06-02 18:58:36 +02:00
data.length > 0 ? (a.innerHTML = data) : (a.style = "hyphens: none;");
2024-05-29 20:51:04 +02:00
// Change link
2024-06-02 18:53:40 +02:00
const href = a.getAttribute("href");
a.setAttribute("href", href.replace(" at ", "@"));
2024-05-03 12:49:50 +02:00
});
});