From 35e56d8faa6e97d75cdfdc5fcc80700921b33920 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 5 Feb 2023 21:42:19 +0300 Subject: [PATCH] Preparing for release v2.5.0 => v2.5.1 --- chromium.md | 6 +-- src/assets/javascripts/services.js | 68 ++++++++++++++++-------------- src/pages/background/background.js | 3 +- src/updates/updates.xml | 2 +- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/chromium.md b/chromium.md index 0de72f4..d199fd7 100644 --- a/chromium.md +++ b/chromium.md @@ -1,6 +1,6 @@ ## Linux -- Download the latest `.crx` file: [libredirect-2.5.0.crx](https://github.com/libredirect/libredirect/releases/download/v2.5.0/libredirect-2.5.0.crx) +- Download the latest `.crx` file: [libredirect-2.5.1.crx](https://github.com/libredirect/libredirect/releases/download/v2.5.1/libredirect-2.5.1.crx) - Open `chrome://extensions` - Enable `dev mode` - Refresh the page @@ -12,11 +12,11 @@ Updates are automatic ## Windows, MacOS -- Download the latest release [libredirect-2.5.0.zip](https://github.com/libredirect/libredirect/releases/download/v2.5.0/libredirect-2.5.0.zip) +- Download the latest release [libredirect-2.5.1.zip](https://github.com/libredirect/libredirect/releases/download/v2.5.1/libredirect-2.5.1.zip) - Unzip it with `Auto detect subfolder` - Open `chrome://extensions` - Enable `dev mode` -- Click `Load unpacked`. Select and Open `libredirect-2.5.0/` +- Click `Load unpacked`. Select and Open `libredirect-2.5.1/` https://user-images.githubusercontent.com/40805353/159987051-8be73cd3-3fdf-4dd0-99d4-8886674fbdb6.mp4 diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 00e4893..6e2eca1 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 99dda03..7f772e1 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 42722e7..9cc07da 100644 --- a/src/updates/updates.xml +++ b/src/updates/updates.xml @@ -1,6 +1,6 @@ - +