diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/assets/javascripts/services.js | 68 | ||||
-rw-r--r-- | src/pages/background/background.js | 3 | ||||
-rw-r--r-- | src/updates/updates.xml | 2 |
3 files changed, 39 insertions, 34 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 00e48932..6e2eca13 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -539,6 +539,38 @@ function reverse(url) { }) } +const defaultInstances = { + 'invidious': ['https://inv.vern.cc'], + 'piped': ['https://pipedapi-libre.kavin.rocks'], + 'pipedMaterial': ['https://piped-material.xn--17b.net'], + 'cloudtube': ['https://tube.cadence.moe'], + 'proxiTok': ['https://proxitok.pabloferreiro.es'], + 'send': ['https://send.vis.ee'], + 'nitter': ['https://nitter.net'], + 'libreddit': ['https://libreddit.spike.codes'], + 'teddit': ['https://teddit.net'], + 'scribe': ['https://scribe.rip'], + 'libMedium': ['https://md.vern.cc'], + 'quetre': ['https://quetre.iket.me'], + 'libremdb': ['https://libremdb.iket.me'], + 'simplyTranslate': ['https://simplytranslate.org'], + 'lingva': ['https://lingva.ml'], + 'searxng': ['https://sx.vern.cc'], + 'rimgo': ['https://rimgo.vern.cc'], + 'librarian': ['https://lbry.vern.cc'], + 'beatbump': ['https://beatbump.ml'], + 'hyperpipe': ['https://hyperpipe.surge.sh'], + 'facil': [' https://facilmap.org '], + 'osm': ['https://www.openstreetmap.org'], + 'breezeWiki': ['https://breezewiki.com'], + 'neuters': ['https://neuters.de'], + 'dumb': ['https://dm.vern.cc'], + 'ruralDictionary': ['https://rd.vern.cc'], + 'anonymousOverflow': ['https://code.whatever.social'], + 'biblioReads': ['https://biblioreads.ml'], + 'wikiless': ['https://wikiless.org'], +} + function initDefaults() { return new Promise(resolve => { browser.storage.local.clear(async () => { @@ -562,35 +594,7 @@ function initDefaults() { options['theme'] = "detect" options['popupServices'] = ["youtube", "twitter", "tiktok", "imgur", "reddit", "quora", "translate", "maps"] - options['invidious'] = ['https://inv.vern.cc'] - options['piped'] = ['https://pipedapi-libre.kavin.rocks'] - options['pipedMaterial'] = ['https://piped-material.xn--17b.net'] - options['cloudtube'] = ['https://tube.cadence.moe'] - options['proxiTok'] = ['https://proxitok.pabloferreiro.es'] - options['send'] = ['https://send.vis.ee'] - options['nitter'] = ['https://nitter.net'] - options['libreddit'] = ['https://libreddit.spike.codes'] - options['teddit'] = ['https://teddit.net'] - options['scribe'] = ['https://scribe.rip'] - options['libMedium'] = ['https://md.vern.cc'] - options['quetre'] = ['https://quetre.iket.me'] - options['libremdb'] = ['https://libremdb.iket.me'] - options['simplyTranslate'] = ['https://simplytranslate.org'] - options['lingva'] = ['https://lingva.ml'] - options['searxng'] = ['https://sx.vern.cc'] - options['rimgo'] = ['https://rimgo.vern.cc'] - options['librarian'] = ['https://lbry.vern.cc'] - options['beatbump'] = ['https://beatbump.ml'] - options['hyperpipe'] = ['https://hyperpipe.surge.sh'] - options['facil'] = [' https://facilmap.org '] - options['osm'] = ['https://www.openstreetmap.org'] - options['breezeWiki'] = ['https://breezewiki.com'] - options['neuters'] = ['https://neuters.de'] - options['dumb'] = ['https://dm.vern.cc'] - options['ruralDictionary'] = ['https://rd.vern.cc'] - options['anonymousOverflow'] = ['https://code.whatever.social'] - options['biblioReads'] = ['https://biblioreads.ml'] - options['wikiless'] = ['https://wikiless.org'] + options = { ...options, ...defaultInstances } browser.storage.local.set({ options }, () => resolve() @@ -636,7 +640,7 @@ function upgradeOptions() { ] } else { - options[frontend] = [] + options[frontend] = defaultInstances[frontend] } } } @@ -664,9 +668,9 @@ function processUpdate() { for (const frontend in config.services[service].frontends) { if (options[frontend] === undefined && config.services[service].frontends[frontend].instanceList) { - options[frontend] = [] + options[frontend] = defaultInstances[frontend] } - else if (frontend in options && frontend in !config.services[service].frontends) { + else if (frontend in options && !(frontend in config.services[service].frontends)) { delete options[frontend] } } diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 99dda03a..7f772e11 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -17,8 +17,9 @@ browser.runtime.onInstalled.addListener(async details => { else if (details.reason == "update") { if (details.previousVersion == '2.3.4') { await servicesHelper.upgradeOptions() + } else { + await servicesHelper.processUpdate() } - // await servicesHelper.processUpdate() } browser.runtime.openOptionsPage() } diff --git a/src/updates/updates.xml b/src/updates/updates.xml index 42722e75..9cc07dad 100644 --- a/src/updates/updates.xml +++ b/src/updates/updates.xml @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'> - <updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.5.0/libredirect-2.5.0.crx' version='2.5.0' /> + <updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.5.1/libredirect-2.5.1.crx' version='2.5.1' /> </app> </gupdate> |