((d) => { d.addEventListener('DOMContentLoaded', () => { /** global: repoUrl */ if(typeof repoUrl == 'undefined') { // example: https://api.github.com/repos/manga-py/manga-py/releases/latest // example: https://api.github.com/repos/yuru-yuri/manga-py/releases/latest return; } fetch(repoUrl) .then(r => r.json()) .then((r) => { const links = d.querySelector('#download-links'); const tar = links.querySelector('.tar'); const zip = links.querySelector('.zip'); tar.setAttribute('href', r.tarball_url); tar.setAttribute('active', 'true'); zip.setAttribute('href', r.zipball_url); zip.setAttribute('active', 'true'); }); const ul = d.querySelector('#supported-list'); if(!ul) { return; } fetch('./providers.json') .then(r => r.json()) .then((r) => { let html = '', m = 0, done = 0; const sites = []; for(let i in r) { if (!r.hasOwnProperty(i)) continue; m+=1; html += '