summaryrefslogtreecommitdiffstats
path: root/src/scripts/about.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:25:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:25:27 +0000
commitec12bd26de5b4292efc366ee41ef4c8d94e31fa9 (patch)
tree30de89024109eff10978e6b95ebd9b403a3e37b7 /src/scripts/about.js
parentInitial commit. (diff)
downloadfoxyproxy-firefox-extension-ec12bd26de5b4292efc366ee41ef4c8d94e31fa9.tar.xz
foxyproxy-firefox-extension-ec12bd26de5b4292efc366ee41ef4c8d94e31fa9.zip
Adding upstream version 7.5.1+dfsg.upstream/7.5.1+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/scripts/about.js')
-rw-r--r--src/scripts/about.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/scripts/about.js b/src/scripts/about.js
new file mode 100644
index 0000000..872a829
--- /dev/null
+++ b/src/scripts/about.js
@@ -0,0 +1,26 @@
+'use strict';
+
+// ----------------- Internationalization ------------------
+document.querySelectorAll('[data-i18n]').forEach(node => {
+ let [text, attr] = node.dataset.i18n.split('|');
+ text = chrome.i18n.getMessage(text);
+ attr ? node[attr] = text : node.appendChild(document.createTextNode(text));
+});
+// ----------------- /Internationalization -----------------
+
+document.addEventListener('keyup', evt => {
+ if (evt.keyCode === 27) {
+ location.href = '/options.html';
+ }
+});
+
+const manifest = chrome.runtime.getManifest();
+document.querySelector('#version').textContent = manifest.version;
+document.querySelector('#edition').textContent = 'FoxyProxy ' + (FOXYPROXY_BASIC ? 'Basic' : 'Standard');
+document.querySelector('button').addEventListener('click', () => location.href = '/options.html');
+
+// --- remove nodes completely for FP Basic
+FOXYPROXY_BASIC && document.querySelectorAll('.notForBasic').forEach(item => item.remove());
+
+// --- welcome on install/update
+location.search === '?welcome' && document.querySelector('.welcome').classList.remove('hide');