replace links

This commit is contained in:
Simon Vieille 2022-04-11 15:17:08 +02:00
commit 9cb216d323
Signed by: deblan
GPG key ID: 03383D15A1D31745

19
main.js
View file

@ -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()
})