replace links
This commit is contained in:
parent
b36ba6e1ca
commit
9cb216d323
1 changed files with 19 additions and 0 deletions
19
main.js
19
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()
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue