Merge branch 'master' into master
This commit is contained in:
commit
46593ef565
|
@ -39,9 +39,11 @@ Privacy Redirect allows setting custom instances, instances can be found here:
|
||||||
- [SearX](https://searx.github.io/searx/)
|
- [SearX](https://searx.github.io/searx/)
|
||||||
- [DuckDuckGo](https://duckduckgo.com)
|
- [DuckDuckGo](https://duckduckgo.com)
|
||||||
- [Startpage](https://startpage.com)
|
- [Startpage](https://startpage.com)
|
||||||
|
- [Ecosia](https://www.ecosia.org)
|
||||||
- [Qwant](https://www.qwant.com)
|
- [Qwant](https://www.qwant.com)
|
||||||
- [Mojeek](https://www.mojeek.com)
|
- [Mojeek](https://www.mojeek.com)
|
||||||
- [Presearch](https://www.presearch.org)
|
- [Presearch](https://www.presearch.org)
|
||||||
|
- [Whoogle](https://benbusby.com/projects/whoogle-search/)
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,10 @@
|
||||||
"message": "Search Engine Instance",
|
"message": "Search Engine Instance",
|
||||||
"description": "Label for Search Engine instance field option (options)."
|
"description": "Label for Search Engine instance field option (options)."
|
||||||
},
|
},
|
||||||
|
"simplyTranslateInstance": {
|
||||||
|
"message": "SimplyTranslate Instance",
|
||||||
|
"description": "Label for SimplyTranslate instance field option (options)."
|
||||||
|
},
|
||||||
"disableNitter": {
|
"disableNitter": {
|
||||||
"message": "Nitter Redirects",
|
"message": "Nitter Redirects",
|
||||||
"description": "Label for enable/disable Nitter redirects option (options & pop-up)."
|
"description": "Label for enable/disable Nitter redirects option (options & pop-up)."
|
||||||
|
@ -55,6 +59,10 @@
|
||||||
"message": "Search Engine Redirects",
|
"message": "Search Engine Redirects",
|
||||||
"description": "Label for enable/disable Search Engine redirects option (options & pop-up)."
|
"description": "Label for enable/disable Search Engine redirects option (options & pop-up)."
|
||||||
},
|
},
|
||||||
|
"disableSimplyTranslate": {
|
||||||
|
"message": "SimplyTranslate Redirects",
|
||||||
|
"description": "Label for enable/disable SimplyTranslate redirects option (options & pop-up)."
|
||||||
|
},
|
||||||
"alwaysProxy": {
|
"alwaysProxy": {
|
||||||
"message": "Always proxy videos through Invidious",
|
"message": "Always proxy videos through Invidious",
|
||||||
"description": "Label for 'Always proxy videos through Invidious' option (options)."
|
"description": "Label for 'Always proxy videos through Invidious' option (options)."
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
{
|
||||||
|
"extensionName": {
|
||||||
|
"message": "Privacy Redirect",
|
||||||
|
"description": "Nombre de la extensión."
|
||||||
|
},
|
||||||
|
"extensionDescription": {
|
||||||
|
"message": "Redirige las solicitudes de Twitter, Youtube, Instagram, Google Maps, Reddit y la Búsqueda de Google a alternativas que respetan su privacidad.",
|
||||||
|
"description": "Descripción de la extensión."
|
||||||
|
},
|
||||||
|
"nitterInstance": {
|
||||||
|
"message": "Instancia de Nitter",
|
||||||
|
"description": "Etiqueta del campo para la instancia de Nitter (opciones)."
|
||||||
|
},
|
||||||
|
"invidiousInstance": {
|
||||||
|
"message": "Instancia de Invidious",
|
||||||
|
"description": "Etiqueta del campo para la instancia de Invidious (opciones)."
|
||||||
|
},
|
||||||
|
"bibliogramInstance": {
|
||||||
|
"message": "Instancia de Bibliogram",
|
||||||
|
"description": "Etiqueta del campo para la instancia de Bibliogram (opciones)."
|
||||||
|
},
|
||||||
|
"osmInstance": {
|
||||||
|
"message": "Instancia de OpenStreetMap",
|
||||||
|
"description": "Etiqueta del campo para la instancia de OSM (opciones)."
|
||||||
|
},
|
||||||
|
"redditInstance": {
|
||||||
|
"message": "Instancia de Reddit",
|
||||||
|
"description": "Etiqueta del campo para la instancia de Reddit (opciones)."
|
||||||
|
},
|
||||||
|
"searchEngineInstance": {
|
||||||
|
"message": "Instancia de Buscador",
|
||||||
|
"description": "Etiqueta del campo para la instancia de Buscador (opciones)."
|
||||||
|
},
|
||||||
|
"disableNitter": {
|
||||||
|
"message": "Redirecciones de Nitter",
|
||||||
|
"description": "Etiqueta para activar/desactivar la opción de redirecciones de Nitter (opciones y pop-up)."
|
||||||
|
},
|
||||||
|
"disableInvidious": {
|
||||||
|
"message": "Redirecciones de Invidious",
|
||||||
|
"description": "Etiqueta para activar/desactivar la opción de redirecciones de Invidious (opciones y pop-up)."
|
||||||
|
},
|
||||||
|
"disableBibliogram": {
|
||||||
|
"message": "Redirecciones de Bibliogram",
|
||||||
|
"description": "Etiqueta para activar/desactivar la opción de redirecciones de Bibliogram (opciones y pop-up)."
|
||||||
|
},
|
||||||
|
"disableOsm": {
|
||||||
|
"message": "Redirecciones de OpenStreetMap",
|
||||||
|
"description": "Etiqueta para activar/desactivar la opción de redirecciones de OSM (opciones y pop-up)."
|
||||||
|
},
|
||||||
|
"disableReddit": {
|
||||||
|
"message": "Redirecciones de Reddit",
|
||||||
|
"description": "Etiqueta para activar/desactivar la opción de redirecciones de Reddit (opciones y pop-up)."
|
||||||
|
},
|
||||||
|
"disableSearchEngine": {
|
||||||
|
"message": "Redirecciones de Buscador",
|
||||||
|
"description": "Etiqueta para activar/desactivar la opción de redirecciones de Buscador (opciones y pop-up)."
|
||||||
|
},
|
||||||
|
"alwaysProxy": {
|
||||||
|
"message": "Siempre usar el proxy de Invidious para videos",
|
||||||
|
"description": "Etiqueta para la opción de 'Siempre usar el proxy de Invidious para videos' (opciones)."
|
||||||
|
},
|
||||||
|
"onlyEmbeddedVideo": {
|
||||||
|
"message": "Solo redirigir los videos incrustados a Invidious",
|
||||||
|
"description": "Etiqueta para la opción de 'Solo redirigir los videos incrustados a Invidious' (opciones)."
|
||||||
|
},
|
||||||
|
"videoQuality": {
|
||||||
|
"message": "Calidad de Video de Invidious",
|
||||||
|
"description": "Etiqueta para la opción de 'Calidad de Video de Invidious' (opciones)."
|
||||||
|
},
|
||||||
|
"removeTwitterSW": {
|
||||||
|
"message": "Eliminar proactivamente el service worker de Twitter",
|
||||||
|
"description": "Etiqueta para la opción de 'Eliminar proactivamente el service worker de Twitter' (opciones)."
|
||||||
|
},
|
||||||
|
"invidiousDarkMode": {
|
||||||
|
"message": "Modo oscuro de Invidious siempre activo",
|
||||||
|
"description": "Etiqueta para la opción de 'Modo oscuro de Invidious siempre activo' (opciones)."
|
||||||
|
},
|
||||||
|
"persistInvidiousPrefs": {
|
||||||
|
"message": "Preservar preferencias de Invidious (como cookie)",
|
||||||
|
"description": "Etiqueta para la opción de 'Preservar preferencias de Invidious (como cookie)' (opciones)."
|
||||||
|
},
|
||||||
|
"generalTab": {
|
||||||
|
"message": "General",
|
||||||
|
"description": "Pestaña general (opciones)."
|
||||||
|
},
|
||||||
|
"advancedTab": {
|
||||||
|
"message": "Avanzado",
|
||||||
|
"description": "Pestaña avanzado (opciones)."
|
||||||
|
},
|
||||||
|
"exceptionsTab": {
|
||||||
|
"message": "Excepciones",
|
||||||
|
"description": "Pestaña de excepciones (opciones)."
|
||||||
|
},
|
||||||
|
"exceptionsDescriptionP1": {
|
||||||
|
"message": "Ingrese la URL o la Expresión Regular a excluir de las redirecciones.",
|
||||||
|
"description": "Una descripción de la función 'Excepciones' párrafo 1 (opciones)."
|
||||||
|
},
|
||||||
|
"exceptionsDescriptionP2": {
|
||||||
|
"message": "Todas las solicitudes para o provenientes de una URL que coincida con la excepción serán excluidas de las redirecciones.",
|
||||||
|
"description": "Una descripción de la función 'Excepciones' párrafo 2 (opciones)."
|
||||||
|
},
|
||||||
|
"exceptionsDescriptionP3": {
|
||||||
|
"message": "Nota – Soporta expresiones regulares de JavaScript, excluyendo las barras oblicuas de cierre.",
|
||||||
|
"description": "Una descripción de la función 'Excepciones' párrafo 3 (opciones)."
|
||||||
|
},
|
||||||
|
"addException": {
|
||||||
|
"message": "Agregar Excepción",
|
||||||
|
"description": "Botón de 'Agregar Excepción' (opciones)."
|
||||||
|
},
|
||||||
|
"moreOptions": {
|
||||||
|
"message": "Más Opciones",
|
||||||
|
"description": "Botón de 'Más Opciones' (pop-up)."
|
||||||
|
},
|
||||||
|
"privacy": {
|
||||||
|
"message": "Privacy",
|
||||||
|
"description": "Título de la extensión - Privacy (pop-up)."
|
||||||
|
},
|
||||||
|
"redirect": {
|
||||||
|
"message": "Redirect",
|
||||||
|
"description": "Título de la extensión - Redirect (pop-up)."
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"message": "Versión",
|
||||||
|
"description": "Versión"
|
||||||
|
},
|
||||||
|
"useFreeTube": {
|
||||||
|
"message": "Usar FreeTube en vez de Invidious cuando sea posible",
|
||||||
|
"description": "Etiqueta para la opción de 'Usar FreeTube en vez de Invidious cuando sea posible' (opciones)."
|
||||||
|
},
|
||||||
|
"nitterRandomPool": {
|
||||||
|
"message": "Grupo de instancias aleatorias de Nitter (separadas por coma)",
|
||||||
|
"description": "Etiqueta para la opción de 'Grupo de instancias aleatorias de Nitter (separadas por coma)' (opciones)."
|
||||||
|
},
|
||||||
|
"invidiousRandomPool": {
|
||||||
|
"message": "Grupo de instancias aleatorias de Invidious (separadas por coma)",
|
||||||
|
"description": "Etiqueta para la opción de 'Grupo de instancias aleatorias de Invidious (separadas por coma)' (opciones)."
|
||||||
|
},
|
||||||
|
"bibliogramRandomPool": {
|
||||||
|
"message": "Grupo de instancias aleatorias de Bibliogram (separadas por coma)",
|
||||||
|
"description": "Etiqueta para la opción de 'Grupo de instancias aleatorias de Bibliogram (separadas por coma)' (opciones)."
|
||||||
|
},
|
||||||
|
"randomInstancePlaceholder": {
|
||||||
|
"message": "Instancia aleatoria (ninguna seleccionada)",
|
||||||
|
"description": "Entrada provisional en la configuración del proveedor de instancia que selecciona una instancia aleatoria del grupo cuando ninguna está seleccionada"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Extension Store (AMO & Chrome Web Store) Listing
|
||||||
|
|
||||||
|
## Summary:
|
||||||
|
|
||||||
|
```
|
||||||
|
Una extensión web simple que redirige las solicitudes de Twitter, Youtube, Instagram, Google Maps, Reddit y la Búsqueda de Google a alternativas que respetan su privacidad.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Description:
|
||||||
|
|
||||||
|
```
|
||||||
|
Redirige las solicitudes de Twitter, Youtube, Instagram, Google Maps, Reddit y la Búsqueda de Google a alternativas que respetan su privacidad. - <a href='https://nitter.net/'>Nitter</a>, <a href='https://invidio.us/'>Invidious</a>, <a href='https://bibliogram.art/'>Bibliogram</a>, & <a href='https://www.openstreetmap.org'>OpenStreetMap</a>.
|
||||||
|
|
||||||
|
Permite ingresar instancias personalizadas, activar/desactivar todas las redirecciones y más.
|
||||||
|
|
||||||
|
<b>★ Más Información: ℹ️</b>
|
||||||
|
<ul>
|
||||||
|
<li><a href='https://github.com/zedeus/nitter#nitter-wip'>Nitter</a></li>
|
||||||
|
<li><a href='https://github.com/omarroth/invidious#invidious'>Invidious</a></li>
|
||||||
|
<li><a href='https://github.com/cloudrac3r/bibliogram#bibliogram'>Bibliogram</a></li>
|
||||||
|
<li><a href='https://wiki.openstreetmap.org/'>OpenStreetMap</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
El código de esta extensión web está disponible en <a href='https://github.com/SimonBrazell/privacy-redirect'>Github</a>.
|
||||||
|
|
||||||
|
<b>★ Dona: 👨🏻💻</b>
|
||||||
|
Si te gusta esta extensión y tienes los recursos económicos, por favor considera <a href='https://www.buymeacoffee.com/SimonBrazell'>comprarme un café</a> ☕️ para mostrar tu aprecio y apoyo al desarrollo del proyecto.
|
||||||
|
|
||||||
|
<b>★ Permisos: ℹ️</b>
|
||||||
|
<ul>
|
||||||
|
<li>Por favor, tenga en cuenta que se requiere acceso a todos los eventos de navegación del sitio web (todas las URL), no solo a los dominios de destino, para permitir redireccionamientos de videos incrustados. En este momento no conozco ninguna otra manera de lograr redirecciones iframe; sin embargo, estaría feliz de escuchar algunas sugerencias al respecto 🙂</li>
|
||||||
|
</ul>
|
||||||
|
```
|
|
@ -2,6 +2,7 @@ const targets = /https?:\/\/(((www|maps)\.)?(google\.).*(\/search)|search\.(goog
|
||||||
const redirects = [
|
const redirects = [
|
||||||
{ link: "https://duckduckgo.com", q: "/" },
|
{ link: "https://duckduckgo.com", q: "/" },
|
||||||
{ link: "https://startpage.com", q: "/search/" },
|
{ link: "https://startpage.com", q: "/search/" },
|
||||||
|
{ link: "https://www.ecosia.org", q: "/search" },
|
||||||
{ link: "https://www.qwant.com", q: "/" },
|
{ link: "https://www.qwant.com", q: "/" },
|
||||||
{ link: "https://www.mojeek.com", q: "/search" },
|
{ link: "https://www.mojeek.com", q: "/search" },
|
||||||
{ link: "https://search.snopyta.org", q: "/" },
|
{ link: "https://search.snopyta.org", q: "/" },
|
||||||
|
@ -14,6 +15,9 @@ const redirects = [
|
||||||
{ link: "https://engine.presearch.org", q: "/search" },
|
{ link: "https://engine.presearch.org", q: "/search" },
|
||||||
{ link: "https://searx.silkky.cloud", q: "/" },
|
{ link: "https://searx.silkky.cloud", q: "/" },
|
||||||
{ link: "https://search.trom.tf", q: "/" },
|
{ link: "https://search.trom.tf", q: "/" },
|
||||||
|
{ link: "https://whoogle.sdf.org", q: "/search" },
|
||||||
|
{ link: "https://whoogle.himiko.cloud", q: "/search" },
|
||||||
|
{ link: "https://whoogle-search.zeet.app", q: "/search" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
const targets = [
|
||||||
|
"translate.google.com"
|
||||||
|
];
|
||||||
|
|
||||||
|
const redirects = [
|
||||||
|
"https://translate.metalune.xyz"
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
targets,
|
||||||
|
redirects,
|
||||||
|
}
|
|
@ -9,13 +9,11 @@ const redirects = [
|
||||||
"https://bibliogram.snopyta.org",
|
"https://bibliogram.snopyta.org",
|
||||||
"https://bibliogram.pussthecat.org",
|
"https://bibliogram.pussthecat.org",
|
||||||
"https://bibliogram.nixnet.services",
|
"https://bibliogram.nixnet.services",
|
||||||
"https://bg.endl.site",
|
|
||||||
"https://bibliogram.13ad.de",
|
|
||||||
"https://bibliogram.pixelfed.uno",
|
|
||||||
"https://bibliogram.ethibox.fr",
|
"https://bibliogram.ethibox.fr",
|
||||||
"https://bibliogram.hamster.dance",
|
"https://bibliogram.hamster.dance",
|
||||||
"https://bibliogram.kavin.rocks",
|
"https://bibliogram.kavin.rocks",
|
||||||
"https://insta.trom.tf",
|
"https://insta.trom.tf",
|
||||||
|
"https://bibliogram.hamster.dance"
|
||||||
];
|
];
|
||||||
const reservedPaths = [
|
const reservedPaths = [
|
||||||
"about",
|
"about",
|
||||||
|
|
|
@ -12,6 +12,7 @@ const redirects = [
|
||||||
"https://libreddit.insanity.wtf",
|
"https://libreddit.insanity.wtf",
|
||||||
"https://libreddit.dothq.co",
|
"https://libreddit.dothq.co",
|
||||||
"https://libreddit.silkky.cloud",
|
"https://libreddit.silkky.cloud",
|
||||||
|
"https://libreddit.himiko.cloud",
|
||||||
// teddit: privacy w/ old UI
|
// teddit: privacy w/ old UI
|
||||||
"https://teddit.net",
|
"https://teddit.net",
|
||||||
"https://teddit.ggc-project.de",
|
"https://teddit.ggc-project.de",
|
||||||
|
|
|
@ -10,8 +10,8 @@ const targets = [
|
||||||
"music.youtube.com",
|
"music.youtube.com",
|
||||||
];
|
];
|
||||||
/*
|
/*
|
||||||
Please remember to also update the manifest.json file
|
Please remember to also update the manifest.json file
|
||||||
(content_scripts > matches, 'persist-invidious-prefs.js')
|
(content_scripts > matches, 'persist-invidious-prefs.js')
|
||||||
when updating this list:
|
when updating this list:
|
||||||
*/
|
*/
|
||||||
const redirects = [
|
const redirects = [
|
||||||
|
@ -33,6 +33,7 @@ const redirects = [
|
||||||
"https://invidious.tinfoil-hat.net",
|
"https://invidious.tinfoil-hat.net",
|
||||||
"https://invidious.namazso.eu",
|
"https://invidious.namazso.eu",
|
||||||
"https://vid.puffyan.us",
|
"https://vid.puffyan.us",
|
||||||
|
"https://dev.viewtube.io",
|
||||||
"https://invidious.048596.xyz",
|
"https://invidious.048596.xyz",
|
||||||
"http://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion",
|
"http://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion",
|
||||||
"http://qklhadlycap4cnod.onion",
|
"http://qklhadlycap4cnod.onion",
|
||||||
|
|
|
@ -58,6 +58,9 @@
|
||||||
"*://invidious.namazso.eu/*",
|
"*://invidious.namazso.eu/*",
|
||||||
"*://vid.puffyan.us/*",
|
"*://vid.puffyan.us/*",
|
||||||
"*://invidious.048596.xyz/*",
|
"*://invidious.048596.xyz/*",
|
||||||
|
"*://dev.viewtube.io/*",
|
||||||
|
"*://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion/*",
|
||||||
|
"*://invidious.048596.yxz/*",
|
||||||
"*://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion/*",
|
"*://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion/*",
|
||||||
"*://qklhadlycap4cnod.onion/*",
|
"*://qklhadlycap4cnod.onion/*",
|
||||||
"*://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion/*",
|
"*://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion/*",
|
||||||
|
@ -74,7 +77,6 @@
|
||||||
"web_accessible_resources": ["assets/javascripts/helpers/*"],
|
"web_accessible_resources": ["assets/javascripts/helpers/*"],
|
||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "{b7f9d2cd-d772-4302-8c3f-eb941af36f76}",
|
|
||||||
"strict_min_version": "60.0"
|
"strict_min_version": "60.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import instagramHelper from "../../assets/javascripts/helpers/instagram.js";
|
||||||
import mapsHelper from "../../assets/javascripts/helpers/google-maps.js";
|
import mapsHelper from "../../assets/javascripts/helpers/google-maps.js";
|
||||||
import redditHelper from "../../assets/javascripts/helpers/reddit.js";
|
import redditHelper from "../../assets/javascripts/helpers/reddit.js";
|
||||||
import searchHelper from "../../assets/javascripts/helpers/google-search.js";
|
import searchHelper from "../../assets/javascripts/helpers/google-search.js";
|
||||||
|
import googleTranslateHelper from "../../assets/javascripts/helpers/google-translate.js";
|
||||||
|
|
||||||
const nitterInstances = twitterHelper.redirects;
|
const nitterInstances = twitterHelper.redirects;
|
||||||
const twitterDomains = twitterHelper.targets;
|
const twitterDomains = twitterHelper.targets;
|
||||||
|
@ -29,6 +30,9 @@ const redditBypassPaths = redditHelper.bypassPaths;
|
||||||
const redditDefault = redditHelper.redirects[0];
|
const redditDefault = redditHelper.redirects[0];
|
||||||
const googleSearchRegex = searchHelper.targets;
|
const googleSearchRegex = searchHelper.targets;
|
||||||
const searchEngineInstances = searchHelper.redirects;
|
const searchEngineInstances = searchHelper.redirects;
|
||||||
|
const simplyTranslateInstances = googleTranslateHelper.redirects;
|
||||||
|
const simplyTranslateDefault = simplyTranslateInstances[0];
|
||||||
|
const googleTranslateDomains = googleTranslateHelper.targets;
|
||||||
|
|
||||||
let disableNitter;
|
let disableNitter;
|
||||||
let disableInvidious;
|
let disableInvidious;
|
||||||
|
@ -36,12 +40,14 @@ let disableBibliogram;
|
||||||
let disableOsm;
|
let disableOsm;
|
||||||
let disableReddit;
|
let disableReddit;
|
||||||
let disableSearchEngine;
|
let disableSearchEngine;
|
||||||
|
let disableSimplyTranslate;
|
||||||
let nitterInstance;
|
let nitterInstance;
|
||||||
let invidiousInstance;
|
let invidiousInstance;
|
||||||
let bibliogramInstance;
|
let bibliogramInstance;
|
||||||
let osmInstance;
|
let osmInstance;
|
||||||
let redditInstance;
|
let redditInstance;
|
||||||
let searchEngineInstance;
|
let searchEngineInstance;
|
||||||
|
let simplyTranslateInstance;
|
||||||
let alwaysProxy;
|
let alwaysProxy;
|
||||||
let onlyEmbeddedVideo;
|
let onlyEmbeddedVideo;
|
||||||
let videoQuality;
|
let videoQuality;
|
||||||
|
@ -66,12 +72,14 @@ browser.storage.sync.get(
|
||||||
"osmInstance",
|
"osmInstance",
|
||||||
"redditInstance",
|
"redditInstance",
|
||||||
"searchEngineInstance",
|
"searchEngineInstance",
|
||||||
|
"simplyTranslateInstance",
|
||||||
"disableNitter",
|
"disableNitter",
|
||||||
"disableInvidious",
|
"disableInvidious",
|
||||||
"disableBibliogram",
|
"disableBibliogram",
|
||||||
"disableOsm",
|
"disableOsm",
|
||||||
"disableReddit",
|
"disableReddit",
|
||||||
"disableSearchEngine",
|
"disableSearchEngine",
|
||||||
|
"disableSimplyTranslate",
|
||||||
"alwaysProxy",
|
"alwaysProxy",
|
||||||
"onlyEmbeddedVideo",
|
"onlyEmbeddedVideo",
|
||||||
"videoQuality",
|
"videoQuality",
|
||||||
|
@ -93,12 +101,14 @@ browser.storage.sync.get(
|
||||||
osmInstance = result.osmInstance || osmDefault;
|
osmInstance = result.osmInstance || osmDefault;
|
||||||
redditInstance = result.redditInstance || redditDefault;
|
redditInstance = result.redditInstance || redditDefault;
|
||||||
searchEngineInstance = result.searchEngineInstance;
|
searchEngineInstance = result.searchEngineInstance;
|
||||||
|
simplyTranslateInstance = result.simplyTranslateInstance || simplyTranslateDefault;
|
||||||
disableNitter = result.disableNitter;
|
disableNitter = result.disableNitter;
|
||||||
disableInvidious = result.disableInvidious;
|
disableInvidious = result.disableInvidious;
|
||||||
disableBibliogram = result.disableBibliogram;
|
disableBibliogram = result.disableBibliogram;
|
||||||
disableOsm = result.disableOsm;
|
disableOsm = result.disableOsm;
|
||||||
disableReddit = result.disableReddit;
|
disableReddit = result.disableReddit;
|
||||||
disableSearchEngine = result.disableSearchEngine;
|
disableSearchEngine = result.disableSearchEngine;
|
||||||
|
disableSimplyTranslate = result.disableSimplyTranslate;
|
||||||
alwaysProxy = result.alwaysProxy;
|
alwaysProxy = result.alwaysProxy;
|
||||||
onlyEmbeddedVideo = result.onlyEmbeddedVideo;
|
onlyEmbeddedVideo = result.onlyEmbeddedVideo;
|
||||||
videoQuality = result.videoQuality;
|
videoQuality = result.videoQuality;
|
||||||
|
@ -138,6 +148,9 @@ browser.storage.onChanged.addListener((changes) => {
|
||||||
if ("osmInstance" in changes) {
|
if ("osmInstance" in changes) {
|
||||||
osmInstance = changes.osmInstance.newValue || osmDefault;
|
osmInstance = changes.osmInstance.newValue || osmDefault;
|
||||||
}
|
}
|
||||||
|
if ("simplyTranslateInstance" in changes) {
|
||||||
|
simplyTranslateInstance = changes.simplyTranslateInstance.newValue || simplyTranslateDefault;
|
||||||
|
}
|
||||||
if ("redditInstance" in changes) {
|
if ("redditInstance" in changes) {
|
||||||
redditInstance = changes.redditInstance.newValue || redditDefault;
|
redditInstance = changes.redditInstance.newValue || redditDefault;
|
||||||
}
|
}
|
||||||
|
@ -162,6 +175,9 @@ browser.storage.onChanged.addListener((changes) => {
|
||||||
if ("disableSearchEngine" in changes) {
|
if ("disableSearchEngine" in changes) {
|
||||||
disableSearchEngine = changes.disableSearchEngine.newValue;
|
disableSearchEngine = changes.disableSearchEngine.newValue;
|
||||||
}
|
}
|
||||||
|
if ("disableSimplyTranslate" in changes) {
|
||||||
|
disableSimplyTranslate = changes.disableSimplyTranslate.newValue;
|
||||||
|
}
|
||||||
if ("alwaysProxy" in changes) {
|
if ("alwaysProxy" in changes) {
|
||||||
alwaysProxy = changes.alwaysProxy.newValue;
|
alwaysProxy = changes.alwaysProxy.newValue;
|
||||||
}
|
}
|
||||||
|
@ -469,6 +485,14 @@ function redirectSearchEngine(url, initiator) {
|
||||||
return `${searchEngine.link}${searchEngine.q}?${search}`;
|
return `${searchEngine.link}${searchEngine.q}?${search}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function redirectGoogleTranslate(url, initiator) {
|
||||||
|
if (disableSimplyTranslate || isException(url, initiator)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${simplyTranslateInstance}/${url.search}`;
|
||||||
|
}
|
||||||
|
|
||||||
browser.webRequest.onBeforeRequest.addListener(
|
browser.webRequest.onBeforeRequest.addListener(
|
||||||
(details) => {
|
(details) => {
|
||||||
const url = new URL(details.url);
|
const url = new URL(details.url);
|
||||||
|
@ -506,6 +530,10 @@ browser.webRequest.onBeforeRequest.addListener(
|
||||||
redirect = {
|
redirect = {
|
||||||
redirectUrl: redirectSearchEngine(url, initiator),
|
redirectUrl: redirectSearchEngine(url, initiator),
|
||||||
};
|
};
|
||||||
|
} else if (googleTranslateDomains.includes(url.host)) {
|
||||||
|
redirect = {
|
||||||
|
redirectUrl: redirectGoogleTranslate(url, initiator),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (redirect && redirect.redirectUrl) {
|
if (redirect && redirect.redirectUrl) {
|
||||||
console.info(
|
console.info(
|
||||||
|
|
|
@ -164,6 +164,25 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
|
<section class="settings-block">
|
||||||
|
<table class="option" aria-label="Toggle SimplyTranslate redirects">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h1 data-localise="__MSG_disableSimplyTranslate__" class="new-badge" data-new-badge>SimplyTranslate Redirects</h1>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input
|
||||||
|
aria-hidden="true"
|
||||||
|
id="disable-simply-translate"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
<label for="disable-simply-translate" class="checkbox-label"></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
<section class="settings-block">
|
<section class="settings-block">
|
||||||
<h1 data-localise="__MSG_nitterInstance__">Nitter Instance</h1>
|
<h1 data-localise="__MSG_nitterInstance__">Nitter Instance</h1>
|
||||||
<div class="autocomplete">
|
<div class="autocomplete">
|
||||||
|
@ -229,6 +248,16 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<section class="settings-block">
|
||||||
|
<h1 data-localise="__MSG_simplyTranslateInstance__">SimplyTranslate Instance</h1>
|
||||||
|
<div class="autocomplete">
|
||||||
|
<input
|
||||||
|
id="simply-translate-instance"
|
||||||
|
type="url"
|
||||||
|
placeholder="https://translate.metalune.xyz"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
<section class="settings-block">
|
<section class="settings-block">
|
||||||
<h1 data-localise="__MSG_theme__">Theme</h1>
|
<h1 data-localise="__MSG_theme__">Theme</h1>
|
||||||
<select id="theme">
|
<select id="theme">
|
||||||
|
|
|
@ -7,6 +7,7 @@ import instagramHelper from "../../assets/javascripts/helpers/instagram.js";
|
||||||
import mapsHelper from "../../assets/javascripts/helpers/google-maps.js";
|
import mapsHelper from "../../assets/javascripts/helpers/google-maps.js";
|
||||||
import redditHelper from "../../assets/javascripts/helpers/reddit.js";
|
import redditHelper from "../../assets/javascripts/helpers/reddit.js";
|
||||||
import searchHelper from "../../assets/javascripts/helpers/google-search.js";
|
import searchHelper from "../../assets/javascripts/helpers/google-search.js";
|
||||||
|
import googleTranslateHelper from "../../assets/javascripts/helpers/google-translate.js";
|
||||||
|
|
||||||
const nitterInstances = twitterHelper.redirects;
|
const nitterInstances = twitterHelper.redirects;
|
||||||
const invidiousInstances = youtubeHelper.redirects;
|
const invidiousInstances = youtubeHelper.redirects;
|
||||||
|
@ -14,6 +15,7 @@ const bibliogramInstances = instagramHelper.redirects;
|
||||||
const osmInstances = mapsHelper.redirects;
|
const osmInstances = mapsHelper.redirects;
|
||||||
const redditInstances = redditHelper.redirects;
|
const redditInstances = redditHelper.redirects;
|
||||||
const searchEngineInstances = searchHelper.redirects;
|
const searchEngineInstances = searchHelper.redirects;
|
||||||
|
const simplyTranslateInstances = googleTranslateHelper.redirects;
|
||||||
const autocompletes = [
|
const autocompletes = [
|
||||||
{ id: "nitter-instance", instances: nitterInstances },
|
{ id: "nitter-instance", instances: nitterInstances },
|
||||||
{ id: "invidious-instance", instances: invidiousInstances },
|
{ id: "invidious-instance", instances: invidiousInstances },
|
||||||
|
@ -24,6 +26,7 @@ const autocompletes = [
|
||||||
id: "search-engine-instance",
|
id: "search-engine-instance",
|
||||||
instances: searchEngineInstances.map((instance) => instance.link),
|
instances: searchEngineInstances.map((instance) => instance.link),
|
||||||
},
|
},
|
||||||
|
{ id: "simply-translate-instance", instances: simplyTranslateInstances },
|
||||||
];
|
];
|
||||||
const domparser = new DOMParser();
|
const domparser = new DOMParser();
|
||||||
|
|
||||||
|
@ -33,12 +36,14 @@ let bibliogramInstance = document.getElementById("bibliogram-instance");
|
||||||
let osmInstance = document.getElementById("osm-instance");
|
let osmInstance = document.getElementById("osm-instance");
|
||||||
let redditInstance = document.getElementById("reddit-instance");
|
let redditInstance = document.getElementById("reddit-instance");
|
||||||
let searchEngineInstance = document.getElementById("search-engine-instance");
|
let searchEngineInstance = document.getElementById("search-engine-instance");
|
||||||
|
let simplyTranslateInstance = document.getElementById("simply-translate-instance");
|
||||||
let disableNitter = document.getElementById("disable-nitter");
|
let disableNitter = document.getElementById("disable-nitter");
|
||||||
let disableInvidious = document.getElementById("disable-invidious");
|
let disableInvidious = document.getElementById("disable-invidious");
|
||||||
let disableBibliogram = document.getElementById("disable-bibliogram");
|
let disableBibliogram = document.getElementById("disable-bibliogram");
|
||||||
let disableOsm = document.getElementById("disable-osm");
|
let disableOsm = document.getElementById("disable-osm");
|
||||||
let disableReddit = document.getElementById("disable-reddit");
|
let disableReddit = document.getElementById("disable-reddit");
|
||||||
let disableSearchEngine = document.getElementById("disable-search-engine");
|
let disableSearchEngine = document.getElementById("disable-search-engine");
|
||||||
|
let disableSimplyTranslate = document.getElementById("disable-simply-translate");
|
||||||
let alwaysProxy = document.getElementById("always-proxy");
|
let alwaysProxy = document.getElementById("always-proxy");
|
||||||
let onlyEmbeddedVideo = document.getElementById("only-embed");
|
let onlyEmbeddedVideo = document.getElementById("only-embed");
|
||||||
let videoQuality = document.getElementById("video-quality");
|
let videoQuality = document.getElementById("video-quality");
|
||||||
|
@ -90,12 +95,14 @@ browser.storage.sync.get(
|
||||||
"osmInstance",
|
"osmInstance",
|
||||||
"redditInstance",
|
"redditInstance",
|
||||||
"searchEngineInstance",
|
"searchEngineInstance",
|
||||||
|
"simplyTranslateInstance",
|
||||||
"disableNitter",
|
"disableNitter",
|
||||||
"disableInvidious",
|
"disableInvidious",
|
||||||
"disableBibliogram",
|
"disableBibliogram",
|
||||||
"disableOsm",
|
"disableOsm",
|
||||||
"disableReddit",
|
"disableReddit",
|
||||||
"disableSearchEngine",
|
"disableSearchEngine",
|
||||||
|
"disableSimplyTranslate",
|
||||||
"alwaysProxy",
|
"alwaysProxy",
|
||||||
"onlyEmbeddedVideo",
|
"onlyEmbeddedVideo",
|
||||||
"videoQuality",
|
"videoQuality",
|
||||||
|
@ -123,12 +130,14 @@ browser.storage.sync.get(
|
||||||
redditInstance.value = result.redditInstance || "";
|
redditInstance.value = result.redditInstance || "";
|
||||||
searchEngineInstance.value =
|
searchEngineInstance.value =
|
||||||
(result.searchEngineInstance && result.searchEngineInstance.link) || "";
|
(result.searchEngineInstance && result.searchEngineInstance.link) || "";
|
||||||
|
simplyTranslateInstance.value = result.simplyTranslateInstance || "";
|
||||||
disableNitter.checked = !result.disableNitter;
|
disableNitter.checked = !result.disableNitter;
|
||||||
disableInvidious.checked = !result.disableInvidious;
|
disableInvidious.checked = !result.disableInvidious;
|
||||||
disableBibliogram.checked = !result.disableBibliogram;
|
disableBibliogram.checked = !result.disableBibliogram;
|
||||||
disableOsm.checked = !result.disableOsm;
|
disableOsm.checked = !result.disableOsm;
|
||||||
disableReddit.checked = !result.disableReddit;
|
disableReddit.checked = !result.disableReddit;
|
||||||
disableSearchEngine.checked = !result.disableSearchEngine;
|
disableSearchEngine.checked = !result.disableSearchEngine;
|
||||||
|
disableSimplyTranslate.checked = !result.disableSimplyTranslate;
|
||||||
alwaysProxy.checked = result.alwaysProxy;
|
alwaysProxy.checked = result.alwaysProxy;
|
||||||
onlyEmbeddedVideo.checked = result.onlyEmbeddedVideo;
|
onlyEmbeddedVideo.checked = result.onlyEmbeddedVideo;
|
||||||
videoQuality.value = result.videoQuality || "";
|
videoQuality.value = result.videoQuality || "";
|
||||||
|
@ -303,6 +312,15 @@ const searchEngineInstanceChange = debounce(() => {
|
||||||
}, 500);
|
}, 500);
|
||||||
searchEngineInstance.addEventListener("input", searchEngineInstanceChange);
|
searchEngineInstance.addEventListener("input", searchEngineInstanceChange);
|
||||||
|
|
||||||
|
const simplyTranslateInstanceChange = debounce(() => {
|
||||||
|
if (simplyTranslateInstance.checkValidity()) {
|
||||||
|
browser.storage.sync.set({
|
||||||
|
simplyTranslateInstance: parseURL(simplyTranslateInstance.value),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
simplyTranslateInstance.addEventListener("input", simplyTranslateInstanceChange);
|
||||||
|
|
||||||
disableNitter.addEventListener("change", (event) => {
|
disableNitter.addEventListener("change", (event) => {
|
||||||
browser.storage.sync.set({ disableNitter: !event.target.checked });
|
browser.storage.sync.set({ disableNitter: !event.target.checked });
|
||||||
});
|
});
|
||||||
|
@ -327,6 +345,10 @@ disableSearchEngine.addEventListener("change", (event) => {
|
||||||
browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
|
browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
disableSimplyTranslate.addEventListener("change", (event) => {
|
||||||
|
browser.storage.sync.set({ disableSimplyTranslate: !event.target.checked });
|
||||||
|
});
|
||||||
|
|
||||||
alwaysProxy.addEventListener("change", (event) => {
|
alwaysProxy.addEventListener("change", (event) => {
|
||||||
browser.storage.sync.set({ alwaysProxy: event.target.checked });
|
browser.storage.sync.set({ alwaysProxy: event.target.checked });
|
||||||
});
|
});
|
||||||
|
|
|
@ -164,6 +164,32 @@
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="settings-block">
|
||||||
|
<table class="option" aria-label="Toggle SimplyTranslate redirects">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h1
|
||||||
|
data-localise="__MSG_disableSimplyTranslate__"
|
||||||
|
class="new-badge"
|
||||||
|
data-new-badge
|
||||||
|
>
|
||||||
|
SimplyTranslate Redirects
|
||||||
|
</h1>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input
|
||||||
|
aria-hidden="true"
|
||||||
|
id="disable-simplyTranslate"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
<label for="disable-simplyTranslate" class="checkbox-label"></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="settings-block"></section>
|
<section class="settings-block"></section>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
|
|
|
@ -6,6 +6,7 @@ let disableBibliogram = document.querySelector("#disable-bibliogram");
|
||||||
let disableOsm = document.querySelector("#disable-osm");
|
let disableOsm = document.querySelector("#disable-osm");
|
||||||
let disableReddit = document.querySelector("#disable-reddit");
|
let disableReddit = document.querySelector("#disable-reddit");
|
||||||
let disableSearchEngine = document.querySelector("#disable-searchEngine");
|
let disableSearchEngine = document.querySelector("#disable-searchEngine");
|
||||||
|
let disableSimplyTranslate = document.querySelector("#disable-simplyTranslate");
|
||||||
let version = document.querySelector("#version");
|
let version = document.querySelector("#version");
|
||||||
|
|
||||||
window.browser = window.browser || window.chrome;
|
window.browser = window.browser || window.chrome;
|
||||||
|
@ -18,6 +19,7 @@ browser.storage.sync.get(
|
||||||
"disableOsm",
|
"disableOsm",
|
||||||
"disableReddit",
|
"disableReddit",
|
||||||
"disableSearchEngine",
|
"disableSearchEngine",
|
||||||
|
"disableSimplyTranslate",
|
||||||
"theme",
|
"theme",
|
||||||
],
|
],
|
||||||
(result) => {
|
(result) => {
|
||||||
|
@ -28,6 +30,7 @@ browser.storage.sync.get(
|
||||||
disableOsm.checked = !result.disableOsm;
|
disableOsm.checked = !result.disableOsm;
|
||||||
disableReddit.checked = !result.disableReddit;
|
disableReddit.checked = !result.disableReddit;
|
||||||
disableSearchEngine.checked = !result.disableSearchEngine;
|
disableSearchEngine.checked = !result.disableSearchEngine;
|
||||||
|
disableSimplyTranslate.checked = !result.disableSimplyTranslate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -57,6 +60,10 @@ disableSearchEngine.addEventListener("change", (event) => {
|
||||||
browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
|
browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
disableSimplyTranslate.addEventListener("change", (event) => {
|
||||||
|
browser.storage.sync.set({ disableSimplyTranslate: !event.target.checked });
|
||||||
|
});
|
||||||
|
|
||||||
document.querySelector("#more-options").addEventListener("click", () => {
|
document.querySelector("#more-options").addEventListener("click", () => {
|
||||||
browser.runtime.openOptionsPage();
|
browser.runtime.openOptionsPage();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue