aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/assets/javascripts/services.js5
-rw-r--r--src/config/config.json4
-rw-r--r--src/instances/blacklist.json3
-rw-r--r--src/instances/data.json34
-rw-r--r--src/instances/get_instances.py7
-rw-r--r--src/pages/background/background.js11
-rw-r--r--src/pages/options/index.html97
7 files changed, 141 insertions, 20 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index eed1e6c6..572a6a9c 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -163,6 +163,11 @@ function redirect(url, type, initiator) {
return `freetube://https://youtu.be${url.pathname}${url.search}`.replace(/watch\?v=/, "")
case "simplyTranslate":
return `${randomInstance}/${url.search}`
+ case "libreTranslate":
+ return `${randomInstance}/${url.search}`
+ .replace(/(?<=\/?)sl/, "source")
+ .replace(/(?<=&)tl/, "target")
+ .replace(/(?<=&)text/, "q")
case "osm": {
if (initiator && initiator.host === "earth.google.com") return
const travelModes = {
diff --git a/src/config/config.json b/src/config/config.json
index 09c95bbb..fde17a02 100644
--- a/src/config/config.json
+++ b/src/config/config.json
@@ -496,6 +496,10 @@
},
"name": "Lingva Translate",
"instanceList": true
+ },
+ "libreTranslate": {
+ "name": "LibreTranslate",
+ "instanceList": true
}
},
"targets": ["^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/", "^https?:\\/{2}translate\\.libredirect\\.invalid"],
diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json
index edce1958..90febd0a 100644
--- a/src/instances/blacklist.json
+++ b/src/instances/blacklist.json
@@ -53,6 +53,7 @@
"https://scribe.rawbit.ninja",
"https://lingva.garudalinux.org",
"https://translate.dr460nf1r3.org",
+ "https://libretranslate.com",
"https://searx.run",
"https://searx.org",
"https://search.garudalinux.org",
@@ -77,11 +78,13 @@
"https://libreddit.notyourcomputer.net",
"https://teddit.ggc-project.de",
"https://teddit.tokhmi.xyz",
+ "https://wiki.privacytools.io",
"https://quetre.odyssey346.dev",
"https://st.odyssey346.dev",
"https://jsearch.pw",
"https://searx.gnu.style",
"https://searx.semipvt.com",
+ "https://searx.tyil.nl",
"https://etsi.me",
"https://search.zzls.xyz",
"https://searx.ericaftereric.top",
diff --git a/src/instances/data.json b/src/instances/data.json
index 839b155b..fac7962d 100644
--- a/src/instances/data.json
+++ b/src/instances/data.json
@@ -6,9 +6,11 @@
"https://invidious.snopyta.org",
"https://invidious.kavin.rocks",
"https://inv.riverside.rocks",
+ "https://invidio.xamh.de",
"https://y.com.sb",
"https://yt.artemislena.eu",
"https://invidious.tiekoetter.com",
+ "https://invidious.sethforprivacy.com",
"https://invidious.flokinet.to",
"https://inv.bp.projectsegfau.lt",
"https://inv.vern.cc",
@@ -19,13 +21,11 @@
"https://invidious.slipfox.xyz",
"https://invidious.esmailelbob.xyz",
"https://youtube.076.ne.jp",
- "https://invidious.sethforprivacy.com",
- "https://invidious.namazso.eu",
- "https://invidio.xamh.de"
+ "https://invidious.namazso.eu"
],
"tor": [
+ "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion",
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
- "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion",
"http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion",
"http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion",
"http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion",
@@ -34,7 +34,7 @@
"http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion",
"http://am74vkcrjp2d5v36lcdqgsj2m6x36tbrkhsruoegwfcizzabnfgf5zyd.onion",
"http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion",
- "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion"
+ "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion"
],
"i2p": [],
"loki": []
@@ -535,6 +535,24 @@
"i2p": [],
"loki": []
},
+ "libreTranslate": {
+ "clearnet": [
+ "https://libretranslate.com",
+ "https://libretranslate.de",
+ "https://translate.argosopentech.com",
+ "https://translate.api.skitzen.com",
+ "https://translate.fortytwo-it.com",
+ "https://translate.terraprint.co",
+ "https://lt.vern.cc"
+ ],
+ "tor": [
+ "http://lt.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"
+ ],
+ "i2p": [
+ "http://vernf45n7mxwqnp5riaax7p67pwcl7wcefdcnqqvim7ckdx4264a.b32.i2p"
+ ],
+ "loki": []
+ },
"searx": {
"clearnet": [
"https://dynabyte.ca",
@@ -572,12 +590,10 @@
"https://suche.uferwerk.org",
"https://sx.catgirl.cloud",
"https://timdor.noip.me/searx",
- "https://xo.wtf",
"https://searx.roflcopter.fr"
],
"tor": [
"http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion",
- "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion",
"http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion",
"http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion",
"http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion",
@@ -667,9 +683,11 @@
"https://trydex.tk/searxng",
"https://www.gruble.de",
"https://www.webrats.xyz",
- "https://xcxc.ml"
+ "https://xcxc.ml",
+ "https://xo.wtf"
],
"tor": [
+ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion",
"http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion",
"http://privateoz3u5utrimal2edr56j3r5caakektxxgixigdkycuxigvquid.onion",
"http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion",
diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py
index 96902feb..9fc64adc 100644
--- a/src/instances/get_instances.py
+++ b/src/instances/get_instances.py
@@ -309,7 +309,7 @@ def bibliogram():
def libreddit():
- fetchRegexList('libreddit', 'Libreddit', 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md', r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|")
+ fetchJsonList('libreddit', 'Libreddit', 'https://github.com/libbacon/libreddit-instances/raw/master/instances.json', {'clearnet': 'url', 'tor': 'onion', 'i2p': 'i2p', 'loki': None}, True)
def teddit():
@@ -433,6 +433,10 @@ def facil():
fetchFromFile('facil', 'FacilMap')
+def libreTranslate():
+ fetchRegexList('libreTranslate', 'LibreTranslate', 'https://raw.githubusercontent.com/LibreTranslate/LibreTranslate/main/README.md', r"\[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\)\|")
+
+
def peertube():
r = requests.get(
'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt')
@@ -470,6 +474,7 @@ quetre()
libremdb()
simplytranslate()
linvgatranslate()
+libreTranslate()
searx_searxng()
whoogle()
librex()
diff --git a/src/pages/background/background.js b/src/pages/background/background.js
index cad08580..e8d0fd76 100644
--- a/src/pages/background/background.js
+++ b/src/pages/background/background.js
@@ -20,17 +20,6 @@ function initDefaults() {
}
browser.runtime.onInstalled.addListener(details => {
- // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) {
- // if (details.reason == "update")
- // browser.storage.local.get(null, r => {
- // if (r.theme) {
- // const old = encodeURIComponent(JSON.stringify(r))
- // browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) });
- // }
- // initDefaults();
- // })
- // else initDefaults();
- // }
switch (details.reason) {
case "install":
initDefaults()
diff --git a/src/pages/options/index.html b/src/pages/options/index.html
index 53ee562e..323984ed 100644
--- a/src/pages/options/index.html
+++ b/src/pages/options/index.html
@@ -2863,6 +2863,7 @@
<select id="translate-frontend">
<option value="simplyTranslate">SimplyTranslate</option>
<option value="lingva">Lingva Translate</option>
+ <option value="libreTranslate">LibreTranslate</option>
</select>
</div>
@@ -3059,6 +3060,102 @@
</div>
</div>
+ <div id="libreTranslate">
+ <div class="clearnet">
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
+ </div>
+ <div class="checklist"></div>
+ <hr>
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
+ </div>
+ <form class="custom-instance-form">
+ <div class="some-block option-block">
+ <input class="custom-instance" placeholder="http://libreTranslate.org" type="url">
+ <button class="add add-instance" type="submit">
+ <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist custom-checklist"></div>
+ <div class="buttons buttons-inline">
+ <label class="button button-inline" id="latency-libreTranslate-label" for="latency-libreTranslate">
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
+ <path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
+ </svg>&nbsp;
+ <x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
+ </label>
+ <input class="button button-inline" id="latency-libreTranslate" style="display:none;">
+ </div>
+ </div>
+ <div class="tor">
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
+ </div>
+ <div class="checklist"></div>
+ <hr>
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
+ </div>
+ <form class="custom-instance-form">
+ <div class="some-block option-block">
+ <input class="custom-instance" placeholder="http://libreTranslate.onion" type="url">
+ <button class="add add-instance" type="submit">
+ <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist custom-checklist"></div>
+ </div>
+ <div class="i2p">
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
+ </div>
+ <div class="checklist"></div>
+ <hr>
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
+ </div>
+ <form class="custom-instance-form">
+ <div class="some-block option-block">
+ <input class="custom-instance" placeholder="http://libreTranslate.i2p" type="url">
+ <button class="add add-instance" type="submit">
+ <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist custom-checklist"></div>
+ </div>
+ <div class="loki">
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
+ </div>
+ <div class="checklist"></div>
+ <hr>
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
+ </div>
+ <form class="custom-instance-form">
+ <div class="some-block option-block">
+ <input class="custom-instance" placeholder="http://libreTranslate.loki" type="url">
+ <button class="add add-instance" type="submit">
+ <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist custom-checklist"></div>
+ </div>
+
+ </div>
</section>
<section class="option-block" id="maps_page">