on master help sign in
Replace window.onload assignment
commit16a7208ba24a748ab72fb5a8dd58532f638ecc27 authorLiam Cooke <noreply@liamcooke.com> dateMon 12 Aug 2019, 21:21 (7 years ago) parentda6318a
1 file changed+2−2
scripts/opml.js+2−2
scripts/opml.js+2−2
@@ -4,10 +4,10 @@ const outlines = sites.filter(site => site.rss).map(site => {
44
55const template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join('')}</body></opml>`
66
7−window.onload = function () {
7+window.addEventListener('DOMContentLoaded', () => {
88 const a = document.getElementById('opml')
99 if (a) {
1010 a.setAttribute('href', 'data:text/plain;charset=utf-8,' + window.encodeURIComponent(template))
1111 a.setAttribute('download', 'webring.opml')
1212 }
13−}
13+})