diff --git a/main.js b/main.js index e69de29..f473a99 100644 --- a/main.js +++ b/main.js @@ -0,0 +1,19 @@ +const replaceLinks = () => { + const links = document.querySelectorAll('.download a') + + for (let link of links) { + let href = link.getAttribute('href') + + if (link.classList.contains('archive-link')) { + href = 'https://dl.gitnet.fr' + href + } else { + href = href.replace('https://gitnet.fr', 'https://dl.gitnet.fr') + } + + link.setAttribute('href', href) + } +} + +document.addEventListener("DOMContentLoaded", () => { + replaceLinks() +})