mylloon.fr/static/js/mail_obfuscation.js

19 lines
492 B
JavaScript
Raw 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:19:58 +02:00
const span = elem.parentElement;
// Replace (at) by @
elem.outerHTML = "@";
// Remove useless span
const a = span.parentElement;
// Correct text
const data = span.getAttribute("data");
a.innerHTML = data.length > 0 ? data : span.textContent;
2024-05-29 20:51:04 +02:00
// Change link
2024-06-02 18:19:58 +02:00
a.setAttribute("href", a.getAttribute("href").replace(" at ", "@"));
2024-05-03 12:49:50 +02:00
});
});