summaryrefslogtreecommitdiffstats
path: root/src/scripts/about.js
blob: 872a8293c99e435b47c0ae734f2e2fe32bb27762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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');