From 89b1343ca61b3864b1a2e3832ca4b7132d6be488 Mon Sep 17 00:00:00 2001 From: cesar Date: Sun, 21 Mar 2021 23:53:37 +0100 Subject: Update 'addons/code/ureject/log.js' --- addons/code/ureject/log.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 addons/code/ureject/log.js (limited to 'addons/code') diff --git a/addons/code/ureject/log.js b/addons/code/ureject/log.js new file mode 100644 index 00000000..14c08782 --- /dev/null +++ b/addons/code/ureject/log.js @@ -0,0 +1,38 @@ +function newrow(w) { + let tt = document.getElementsByTagName('tbody')[0]; + let tr = tt.insertRow(tt.rows.length); + tr.innerHTML = w; +} +document.addEventListener('DOMContentLoaded', () => { + browser.storage.local.get(['ul']).then((r) => { + fetch('i18n/' + (r.ul || 'eo') + '.json', { + method: 'GET' + }).then(j => j.json()).then(j => { + document.querySelectorAll('span[transk]').forEach(x => { + x.innerText = j[x.getAttribute('transk')]; + }); + newrow('FQDN' + j['lj1'] + '' + j['lj2'] + '' + j['lj3'] + '' + j['lj4'] + ''); + browser.runtime.sendMessage('get').then(g => { + for (let k in g) { + newrow('' + k + '' + g[k][1] + '' + g[k][2] + ' 🔗 ' + g[k][3] + ''); + document.getElementById('export').innerHTML += k + "\n"; + } + }); + document.body.style.display = 'block'; + }); + }); + document.getElementById('clear').addEventListener('click', () => { + browser.runtime.sendMessage('clear').then(() => { + location.reload(true); + }); + }); + document.getElementById('myul').addEventListener('change', () => { + if (document.getElementById('myul').value != '') { + browser.storage.local.set({ + 'ul': document.getElementById('myul').value + }).then(() => { + location.reload(true); + }); + } + }); +}); \ No newline at end of file -- cgit v1.2.3