diff options
author | SimonBrazell <simon@brazell.com.au> | 2021-01-11 17:46:00 +1100 |
---|---|---|
committer | SimonBrazell <simon@brazell.com.au> | 2021-01-11 17:46:00 +1100 |
commit | 223d7cd0ac245f5b5186439a832f6607451a7800 (patch) | |
tree | dac535654f780efbda5b3eeb992ca29f0120294a /src | |
parent | gecko: strict_min_version: 67.0 due to dynamic imports (diff) | |
download | libredirect-223d7cd0ac245f5b5186439a832f6607451a7800.zip |
CLoses #130 changed to GPLv3, added SearX instances (#16), fixed instance selects.
Diffstat (limited to 'src')
-rw-r--r-- | src/_locales/de/messages.json | 110 | ||||
-rw-r--r-- | src/_locales/de/store.md | 33 | ||||
-rw-r--r-- | src/_locales/en/messages.json | 142 | ||||
-rw-r--r-- | src/_locales/en/store.md | 33 | ||||
-rw-r--r-- | src/_locales/fr/messages.json | 110 | ||||
-rw-r--r-- | src/_locales/fr/store.md | 33 | ||||
-rw-r--r-- | src/_locales/pl/messages.json | 110 | ||||
-rw-r--r-- | src/_locales/pl/store.md | 32 | ||||
-rw-r--r-- | src/_locales/ru/messages.json | 154 | ||||
-rw-r--r-- | src/_locales/ru/store.md | 33 | ||||
-rw-r--r-- | src/_locales/zh_CN/messages.json | 110 | ||||
-rw-r--r-- | src/_locales/zh_CN/store.md | 33 | ||||
-rw-r--r-- | src/assets/javascripts/helpers/google-search.js | 7 | ||||
-rw-r--r-- | src/assets/javascripts/helpers/reddit.js | 14 | ||||
-rw-r--r-- | src/assets/javascripts/remove-twitter-sw.js | 241 | ||||
-rw-r--r-- | src/manifest.json | 71 | ||||
-rw-r--r-- | src/pages/background/background.html | 7 | ||||
-rw-r--r-- | src/pages/options/options.html | 2 | ||||
-rw-r--r-- | src/pages/options/options.js | 14 | ||||
-rw-r--r-- | src/web-ext-config.js | 8 |
20 files changed, 1212 insertions, 85 deletions
diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json new file mode 100644 index 00000000..431ed1d4 --- /dev/null +++ b/src/_locales/de/messages.json @@ -0,0 +1,110 @@ +{ + "extensionName": { + "message": "Privacy Redirect", + "description": "Name of the extension." + }, + "extensionDescription": { + "message": "Leitet Anfragen von Twitter, YouTube, Instagram & Google Maps auf datenschutzfreundliche Alternativen weiter.", + "description": "Description of the extension." + }, + "nitterInstance": { + "message": "Nitter-Instanz", + "description": "Label for Nitter instance field option (options)." + }, + "invidiousInstance": { + "message": "Invidious-Instanz", + "description": "Label for Invidious instance field option (options)." + }, + "bibliogramInstance": { + "message": "Bibliogram-Instanz", + "description": "Label for Bibliogram instance field option (options)." + }, + "osmInstance": { + "message": "OpenStreetMap-Instanz", + "description": "Label for OSM instance field option (options)." + }, + "disableNitter": { + "message": "Nitter-Weiterleitungen", + "description": "Label for enable/disable Nitter redirects option (options & pop-up)." + }, + "disableInvidious": { + "message": "Invidious-Weiterleitungen", + "description": "Label for enable/disable Invidious redirects option (options & pop-up)." + }, + "disableBibliogram": { + "message": "Bibliogram-Weiterleitungen", + "description": "Label for enable/disable Bibliogram redirects option (options & pop-up)." + }, + "disableOsm": { + "message": "OpenStreetMap-Weiterleitungen", + "description": "Label for enable/disable OSM redirects option (options & pop-up)." + }, + "alwaysProxy": { + "message": "Videos immer durch Invidious-Proxy leiten", + "description": "Label for 'Always proxy videos through Invidious' option (options)." + }, + "onlyEmbeddedVideo": { + "message": "Nur eingebettete Videos zu Invidious weiterleiten", + "description": "Label for 'Only redirect embedded video to Invidious' option (options)." + }, + "videoQuality": { + "message": "Videoqualität bei Invidious", + "description": "Label for 'Invidious Video Quality' option (options)." + }, + "removeTwitterSW": { + "message": "Twitter-Serviceworker proaktiv entfernen", + "description": "Label for 'Proactively remove Twitter service worker' option (options)." + }, + "invidiousDarkMode": { + "message": "Dunklen Modus auf Invidious immer anschalten", + "description": "Label for 'Invidious dark mode always on' option (options)." + }, + "persistInvidiousPrefs": { + "message": "Invidious-Einstellungen dauerhaft beibehalten (als Cookie)", + "description": "Label for 'Persist Invidious preferences (as cookie)' option (options)." + }, + "generalTab": { + "message": "Allgmein", + "description": "General tab (options)." + }, + "advancedTab": { + "message": "Erweitert", + "description": "Advanced tab (options)." + }, + "exceptionsTab": { + "message": "Ausnahmen", + "description": "Exceptions tab (options)." + }, + "exceptionsDescriptionP1": { + "message": "Gib eine URL oder einen regulären Ausdruck (Regex) ein, die/der von Weiterleitungen ausgeschlossen werden soll.", + "description": "A description of the 'Exceptions' feature paragraph 1 (options)." + }, + "exceptionsDescriptionP2": { + "message": "Alle Anfragen für oder ausgehend von einer URL, die auf die Ausnahme zutrifft, werden von Weiterleitungen ausgeschlossen.", + "description": "A description of the 'Exceptions' feature paragraph 2 (options)." + }, + "exceptionsDescriptionP3": { + "message": "Hinweis – Unterstützt reguläre JavaScript-Ausdrücke (Regex), mit Ausnahme der einschließenden Schrägstriche.", + "description": "A description of the 'Exceptions' feature paragraph 3 (options)." + }, + "addException": { + "message": "Ausnahme hinzufügen", + "description": "'Add Exceptions' button (options)." + }, + "moreOptions": { + "message": "Weitere Optionen", + "description": "More Options button (pop-up)." + }, + "privacy": { + "message": "Privacy", + "description": "Extension title - Privacy (pop-up)." + }, + "redirect": { + "message": "Redirect", + "description": "Extension title - Redirect (pop-up)." + }, + "version": { + "message": "Version", + "description": "Version" + } +} diff --git a/src/_locales/de/store.md b/src/_locales/de/store.md new file mode 100644 index 00000000..e88df91e --- /dev/null +++ b/src/_locales/de/store.md @@ -0,0 +1,33 @@ +# Extension Store (AMO & Chrome Web Store) Listing + +## Summary: + +``` +Eine einfache Browser-Erweiterung, die Anfragen an Twitter, YouTube, Instagram & Google Maps zu datenschutzfreundlichen Alternativen weiterleitet. +``` + +## Description: + +``` +Leitet Anfragen an Twitter, YouTube, Instagram & Google Maps zu datenschutzfreundlichen Alternativen weiter – <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>. + +Erlaubt das Einstellen benutzerdefinierter Instanzen, das Ein- und Ausschalten aller Weiterleitungen und vieles mehr. + +<b>★ Weitere Infos: ℹ️</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> + +Der Code dieser Browser-Erweiterung ist verfügbar auf <a href='https://github.com/SimonBrazell/privacy-redirect'>Github</a>. + +<b>★ Spenden: 👨🏻💻</b> +Wenn Ihnen diese Erweiterung gefällt und Sie finanziell in der Lage sind, erwägen Sie bitte <a href='https://www.buymeacoffee.com/SimonBrazell'> mir auf BuyMeACoffee einen Kaffee zu kaufen</a> ☕️ ️ um Ihre Wertschätzung zu zeigen und die Fortsetzung des Projekts zu unterstützen. + +<b>★ Berechtigungen: ℹ️</b> +<ul> + <li>Bitte beachten Sie, dass der Zugriff auf alle Website-Navigationsereignisse ( alle URLs), nicht nur auf die Zieldomains, erforderlich ist, damit eingebettete Video-Weiterleitungen stattfinden können. Zur Zeit kenne ich keine andere Möglichkeit, Iframe-Weiterleitungen zu realisieren, freue mich aber über Vorschläge dazu 🙂</li> +</ul> +``` diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json new file mode 100644 index 00000000..da518d36 --- /dev/null +++ b/src/_locales/en/messages.json @@ -0,0 +1,142 @@ +{ + "extensionName": { + "message": "Privacy Redirect", + "description": "Name of the extension." + }, + "extensionDescription": { + "message": "Redirects Twitter, YouTube, Instagram, Google Maps, Reddit & Google Search requests to privacy friendly alternatives.", + "description": "Description of the extension." + }, + "nitterInstance": { + "message": "Nitter Instance", + "description": "Label for Nitter instance field option (options)." + }, + "invidiousInstance": { + "message": "Invidious Instance", + "description": "Label for Invidious instance field option (options)." + }, + "bibliogramInstance": { + "message": "Bibliogram Instance", + "description": "Label for Bibliogram instance field option (options)." + }, + "osmInstance": { + "message": "OpenStreetMap Instance", + "description": "Label for OSM instance field option (options)." + }, + "redditInstance": { + "message": "Reddit Instance", + "description": "Label for Reddit instance field option (options)." + }, + "searchEngineInstance": { + "message": "Search Engine Instance", + "description": "Label for Search Engine instance field option (options)." + }, + "disableNitter": { + "message": "Nitter Redirects", + "description": "Label for enable/disable Nitter redirects option (options & pop-up)." + }, + "disableInvidious": { + "message": "Invidious Redirects", + "description": "Label for enable/disable Invidious redirects option (options & pop-up)." + }, + "disableBibliogram": { + "message": "Bibliogram Redirects", + "description": "Label for enable/disable Bibliogram redirects option (options & pop-up)." + }, + "disableOsm": { + "message": "OpenStreetMap Redirects", + "description": "Label for enable/disable OSM redirects option (options & pop-up)." + }, + "disableReddit": { + "message": "Reddit Redirects", + "description": "Label for enable/disable Reddit redirects option (options & pop-up)." + }, + "disableSearchEngine": { + "message": "Search Engine Redirects", + "description": "Label for enable/disable Search Engine redirects option (options & pop-up)." + }, + "alwaysProxy": { + "message": "Always proxy videos through Invidious", + "description": "Label for 'Always proxy videos through Invidious' option (options)." + }, + "onlyEmbeddedVideo": { + "message": "Only redirect embedded video to Invidious", + "description": "Label for 'Only redirect embedded video to Invidious' option (options)." + }, + "videoQuality": { + "message": "Invidious Video Quality", + "description": "Label for 'Invidious Video Quality' option (options)." + }, + "removeTwitterSW": { + "message": "Proactively remove Twitter service worker", + "description": "Label for 'Proactively remove Twitter service worker' option (options)." + }, + "invidiousDarkMode": { + "message": "Invidious dark mode always on", + "description": "Label for 'Invidious dark mode always on' option (options)." + }, + "persistInvidiousPrefs": { + "message": "Persist Invidious preferences (as cookie)", + "description": "Label for 'Persist Invidious preferences (as cookie)' option (options)." + }, + "generalTab": { + "message": "General", + "description": "General tab (options)." + }, + "advancedTab": { + "message": "Advanced", + "description": "Advanced tab (options)." + }, + "exceptionsTab": { + "message": "Exceptions", + "description": "Exceptions tab (options)." + }, + "exceptionsDescriptionP1": { + "message": "Enter a URL or Regular Expression to be excluded from redirects.", + "description": "A description of the 'Exceptions' feature paragraph 1 (options)." + }, + "exceptionsDescriptionP2": { + "message": "All requests for or initiating from a URL that matches the exception will be excluded from redirects.", + "description": "A description of the 'Exceptions' feature paragraph 2 (options)." + }, + "exceptionsDescriptionP3": { + "message": "Note - Supports JavaScript regular expressions, excluding the enclosing forward slashes.", + "description": "A description of the 'Exceptions' feature paragraph 3 (options)." + }, + "addException": { + "message": "Add Exception", + "description": "'Add Exceptions' button (options)." + }, + "moreOptions": { + "message": "More Options", + "description": "More Options button (pop-up)." + }, + "privacy": { + "message": "Privacy", + "description": "Extension title - Privacy (pop-up)." + }, + "redirect": { + "message": "Redirect", + "description": "Extension title - Redirect (pop-up)." + }, + "version": { + "message": "Version", + "description": "Version" + }, + "useFreeTube": { + "message": "Use FreeTube over Invidious when possible", + "description": "Label for 'Use FreeTube over Invidious when possible' option (options)." + }, + "nitterRandomPool": { + "message": "Nitter random instance pool (comma-separated)", + "description": "Label for 'Nitter random instance pool (comma-separated)' option (options)." + }, + "invidiousRandomPool": { + "message": "Invidious random instance pool (comma-separated)", + "description": "Label for 'Invidious random instance pool (comma-separated)' option (options)." + }, + "bibliogramRandomPool": { + "message": "Bibliogram random instance pool (comma-separated)", + "description": "Label for 'Bibliogram random instance pool (comma-separated)' option (options)." + } +} diff --git a/src/_locales/en/store.md b/src/_locales/en/store.md new file mode 100644 index 00000000..69b47c3c --- /dev/null +++ b/src/_locales/en/store.md @@ -0,0 +1,33 @@ +# Extension Store (AMO & Chrome Web Store) Listing + +## Summary: + +``` +A simple web extension that redirects Twitter, YouTube, Instagram & Google Maps requests to privacy friendly alternatives. +``` + +## Description: + +``` +Redirects Twitter, YouTube, Instagram, & Google Maps requests to privacy friendly alternatives - <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>. + +Allows for setting custom instances, toggling all redirects on/off and more. + +<b>★ More Info: ℹ️</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> + +The code for this web extension is available on <a href='https://github.com/SimonBrazell/privacy-redirect'>Github</a>. + +<b>★ Donate: 👨🏻💻</b> +If you like this extension and are financially able please consider <a href='https://www.buymeacoffee.com/SimonBrazell'>buying me a coffee</a> ☕️ ️to show your appreciation and support the continuation of the project. + +<b>★ Permissions: ℹ️</b> +<ul> + <li>Please note, access to all website navigation events ( all URLs), not just the target domains, is required to allow embedded video redirects to occur. At this time I know of no other way to achieve iframe redirects, happy to hear some suggestions on this though 🙂</li> +</ul> +``` diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json new file mode 100644 index 00000000..7b66ab42 --- /dev/null +++ b/src/_locales/fr/messages.json @@ -0,0 +1,110 @@ +{ + "extensionName": { + "message": "Privacy Redirect", + "description": "Nom du module complémentaire." + }, + "extensionDescription": { + "message": "Redirige les requêtes les demandes Twitter, YouTube, Instagram et Google Maps vers des alternatives respectueuses de la vie privée. pour Twitter, YouTube, Instagram et Google Maps vers des alternatives respectueuses de la vie privée.", + "description": "Description du module complémentaire." + }, + "nitterInstance": { + "message": "Instance de Nitter", + "description": "Étiquette pour l'option de champ d'instance Nitter (options)." + }, + "invidiousInstance": { + "message": "Instance de Invidious", + "description": "Étiquette pour l'option de champ d'instance Invidious (options)." + }, + "bibliogramInstance": { + "message": "Instance de Bibliogram", + "description": "Étiquette pour l'option de champ d'instance Bibliogram (options)." + }, + "osmInstance": { + "message": "Instance de OpenStreetMap", + "description": "Étiquette pour l'option de champ d'instance OpenStreetMap (options)." + }, + "disableNitter": { + "message": "Redirection vers Nitter", + "description": "Étiquette pour activer / désactiver l'option de redirection vers Nitter (options et pop-up)." + }, + "disableInvidious": { + "message": "Redirection vers Invidious", + "description": "Étiquette pour activer / désactiver l'option de redirection vers Invidious (options et pop-up)." + }, + "disableBibliogram": { + "message": "Redirection vers Bibliogram", + "description": "Étiquette pour activer / désactiver l'option de redirection vers Bibliogram (options et pop-up)." + }, + "disableOsm": { + "message": "Redirection vers OpenStreetMap", + "description": "Étiquette pour activer / désactiver l'option de redirection vers OpenStreetMap (options et pop-up)." + }, + "alwaysProxy": { + "message": "Toujours transiter par proxy les vidéos via Invidious", + "description": "Libellé pour l'option 'Toujours transiter par proxy les vidéos via Invidious' (options)." + }, + "onlyEmbeddedVideo": { + "message": "Rediriger uniquement les vidéos intégrées vers Invidious", + "description": "Libellé pour l'option 'Rediriger uniquement les vidéos intégrées vers Invidious' (options)." + }, + "videoQuality": { + "message": "Qualité des vidéos Invidious", + "description": "Libellé pour l'option 'Qualité des vidéos Invidious' (options)." + }, + "removeTwitterSW": { + "message": "Supprimer proactivement le service worker de Twitter", + "description": "Libellé pour l'option 'Supprimer proactivement le service worker de Twitter' (options)." + }, + "invidiousDarkMode": { + "message": "Mode sombre toujours activé pour Invidious", + "description": "Libellé pour l'option 'Mode sombre toujours activé pour Invidious' (options)." + }, + "persistInvidiousPrefs": { + "message": "Conserver les préférences d’Invidious (sous forme de cookie)", + "description": "Libellé pour 'Conserver les préférences d’Invidious (sous forme de cookie)' option (options)." + }, + "generalTab": { + "message": "Général", + "description": "Onglet général (options)." + }, + "advancedTab": { + "message": "Avancé", + "description": "Onglet avancé (options)." + }, + "exceptionsTab": { + "message": "Exceptions", + "description": "Onglet des Exceptions dans les options." + }, + "exceptionsDescriptionP1": { + "message": "Entrez une adresse URL ou une expression régulière qui sera exclue des redirections.", + "description": "Description pour la rubrique 'Exceptions' dans les options." + }, + "exceptionsDescriptionP2": { + "message": "Toutes les demandes émanant d'une adresse URL et correspondant à l'exception seront exclues des redirections.", + "description": "Description pour la rubrique 'Exceptions' dans les options." + }, + "exceptionsDescriptionP3": { + "message": "Remarque - Prend en charge les expressions régulières JavaScript, à l'exclusion des barres slash.", + "description": "Description pour la rubrique 'Exceptions' dans les options." + }, + "addException": { + "message": "Ajoutez une exception", + "description": "boutton 'Ajoutez une exception' dans les options." + }, + "moreOptions": { + "message": "Options supplémentaires", + "description": "Boutton des options supplémentaires (pop-up)." + }, + "privacy": { + "message": "Vie privée", + "description": "Titre du module complémentaire - Vie privée (pop-up)." + }, + "redirect": { + "message": "Redirection", + "description": "Titre du module complémentaire - Redirection (pop-up)." + }, + "version": { + "message": "Version", + "description": "Version" + } +} diff --git a/src/_locales/fr/store.md b/src/_locales/fr/store.md new file mode 100644 index 00000000..dc29f4f7 --- /dev/null +++ b/src/_locales/fr/store.md @@ -0,0 +1,33 @@ +# Extension Store (AMO & Chrome Web Store) Listing + +## Summary: + +``` +Redirige les requêtes les demandes Twitter, YouTube, Instagram et Google Maps vers des alternatives respectueuses de la vie privée. pour Twitter, YouTube, Instagram et Google Maps vers des alternatives respectueuses de la vie privée. +``` + +## Description: + +``` +Redirige les requètes pour Twitter, YouTube, Instagram et Google Maps vers des alternatives respectueuses de la confidentialité - <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>. + +Permet de définir des instances personnalisées et d'activer ou désactiver toutes les redirections. + +<b>★ Plus d'informations: ℹ️</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> + +Le code de cette extension Web est disponible sur <a href="https://github.com/SimonBrazell/privacy-redirect">Github</a>. + +<b>★ Faire un don: 👨🏻💻</b> +Si vous aimez ce module complémentaire et si vous avez une bonne situation financière, pensez à <a href="https://www.buymeacoffee.com/SimonBrazell">m'acheter un café</a> ☕️ pour montrer que vous appréciez et soutenez la poursuite du projet. + +<b>★ Autorisations: ℹ️</b> +<ul> +<li>Veuillez noter que l'accès à tous les événements de navigation sur le site Web (toutes les adresses URL), et pas seulement aux domaines cibles, est requis pour permettre aux redirections vidéo intégrées de se faire correctement. Pour le moment, je ne connais aucun autre moyen de réaliser des redirections iframe, je serais heureux d'entendre quelques suggestions à ce sujet cependant 🙂</li> +</ul> +``` diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json new file mode 100644 index 00000000..85877663 --- /dev/null +++ b/src/_locales/pl/messages.json @@ -0,0 +1,110 @@ +{ + "extensionName": { + "message": "Privacy Redirect", + "description": "Nazwa rozszerzenia." + }, + "extensionDescription": { + "message": "Przekierowuje serwisy takie jak: Twitter, YouTube, Instagram i Google Maps do alternatyw sprzyjających prywatności.", + "description": "Opis rozszerzenia." + }, + "nitterInstance": { + "message": "Instancja Nitter", + "description": "Etykieta dla pola wyboru instancji Nitter (opcje)." + }, + "invidiousInstance": { + "message": "Instancja Invidious", + "description": "Etykieta dla pola wyboru instancji Invidious (opcje)." + }, + "bibliogramInstance": { + "message": "Instancja Bibliogram", + "description": "Etykieta dla pola wyboru instancji Bibliogram (opcje)." + }, + "osmInstance": { + "message": "Instancja OpenStreetMap", + "description": "Etykieta dla pola wyboru instancji OpenStreetMap (opcje)." + }, + "disableNitter": { + "message": "Przekierowanie Nitter", + "description": "Etykieta dla włączenia/wyłączenia opcji przekierowania Nitter (opcje i okno pop-up)." + }, + "disableInvidious": { + "message": "Przekierowanie Invidious ", + "description": "Etykieta dla włączenia/wyłączenia opcji przekierowania Invidious (opcje i okno pop-up)." + }, + "disableBibliogram": { + "message": "Przekierowanie Bibliogram", + "description": "Etykieta dla włączenia/wyłączenia opcji przekierowania Bibliogram (opcje i okno pop-up)." + }, + "disableOsm": { + "message": "Przekierowanie OpenStreetMap", + "description": "Etykieta dla włączenia/wyłączenia opcji przekierowania OpenStreetMap (opcje i okno pop-up)." + }, + "alwaysProxy": { + "message": "Zawsze buforuj i wyświetlaj odnośniki wideo z YouTube poprzez Invidious", + "description": "Etykieta dla opcji 'Zawsze buforuj i wyświetlaj odnośniki wideo poprzez Invidious'." + }, + "onlyEmbeddedVideo": { + "message": "Jedynie przekieruj odnośniki wideo do instancji Invidious", + "description": "Etykieta dla opcji 'Jedynie przekieruj odnośniki wideo do instancji Invidious'." + }, + "videoQuality": { + "message": "Jakość wideo Invidious", + "description": "Etykieta dla opcji 'Jakość wideo Invidious'." + }, + "removeTwitterSW": { + "message": "Proaktywnie usuwaj skrypty serwisowe (service worker) Twittera", + "description": "Etykieta dla opcji 'Proaktywnie usuwaj skrypty serwisowe (service worker) Twittera'." + }, + "invidiousDarkMode": { + "message": "Tryb ciemny dla Invidious zawsze włączony", + "description": "Etykieta dla opcji 'Tryb ciemny dla Invidious zawsze włączony'." + }, + "persistInvidiousPrefs": { + "message": "Zapisz ustawienia Invidious (jako plik cookie)", + "description": "Etykieta dla 'Zapisz ustawienia Invidious (jako plik cookie)'." + }, + "generalTab": { + "message": "Główne", + "description": "Zakładka Główne (opcje)." + }, + "advancedTab": { + "message": "Advanced", + "description": "Zakładka zaawansowane (opcje)." + }, + "exceptionsTab": { + "message": "Wyjątki", + "description": "Zakładka wyjątki (opcje)." + }, + "exceptionsDescriptionP1": { + "message": "Wprowadź adres URL lub wyrażenie regularne, które zostanie wyłączone z przekierowania. ", + "description": "Opis funkcji 'Wyjątki' paragraf 1 (opcje)." + }, + "exceptionsDescriptionP2": { + "message": "Wszystkie żądania dla lub inicjalizujące z adresu URL które spełniają wyjątek zostaną wyłączone z przekierowania.", + "description": "Opis funkcji 'Wyjątki' paragraf 2 (opcje)." + }, + "exceptionsDescriptionP3": { + "message": "Informacja - Wspierane są wyrażenia regularne JavaScript, wyłączając ukośniki lewe zamykające.", + "description": "Opis funkcji 'Wyjątki' paragraf 3 (opcje)." + }, + "addException": { + "message": "Dodaj wyjątek", + "description": "Przycisk 'Dodaj wyjątek' (opcje)." + }, + "moreOptions": { + "message": "Więcej opcji", + "description": "Przycisk 'Więcej opcji' (okno pop-up)." + }, + "privacy": { + "message": "Prywatność", + "description": "Tytuł rozszerzenia - Privacy (okno pop-up)." + }, + "redirect": { + "message": "Redirect", + "description": "Tytuł rozszerzenia - Redirect (pop-up)." + }, + "version": { + "message": "Version", + "description": "Wersja" + } +} diff --git a/src/_locales/pl/store.md b/src/_locales/pl/store.md new file mode 100644 index 00000000..575e15b6 --- /dev/null +++ b/src/_locales/pl/store.md @@ -0,0 +1,32 @@ +# Extension Store (AMO & Chrome Web Store) Listing + +## Summary: + +``` +Prosta wtyczka która przekierowuje żądania Twitter, YouTube, Instagram oraz Google Maps na odpowiedniki przyjazne dla prywatności. +``` + +## Description: + +``` +Przekierowuje żądania Twitter, YouTube, Instagram oraz Google Maps na odpowiedniki przyjazne dla prywatności - <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>. + +Umożliwia ustawienie niestandardowych instancji usług, przełączania przekierowania jako aktywne/nieaktwne i o wiele więcej. +<b>★ Więcej informacji: ℹ️</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> + +Kod źródłowy tego rozszerzenia jest dostępny na: <a href='https://github.com/SimonBrazell/privacy-redirect'>Github</a>. + +<b>★ Donate: 👨🏻💻</b> +Jeżeli lubisz to rozszerzenie i chcesz wesprzeć autora finanosowo, proszę pomyśl o <a href='https://www.buymeacoffee.com/SimonBrazell'>zaserwowaniu małej czarnej</a> ☕️ ️aby pokazać swoją wdzięczność i wesprzeć możliwości kontynuowania projektu. + +<b>★ Uprawnienia: ℹ️</b> +<ul> + <li>Zwróć uwagę, że dostęp do wszystkich zdarzeń dotyczących nawigacji po stronach (wszystkie adresy URL) jest wymagany dla poprawnego odtwarzania osadzonych plików wideo. Obecnie nie znam innych możliwości aby obsłużyć przekierowania ramek iFrame, będę wdzięczny za sugestie 🙂</li> +</ul> +``` diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json new file mode 100644 index 00000000..a993f042 --- /dev/null +++ b/src/_locales/ru/messages.json @@ -0,0 +1,154 @@ +{ + "extensionName": { + "message": "Privacy Redirect", + "description": "Название расширения." + }, + "extensionDescription": { + "message": "Перенаправляет запросы к Twitter, YouTube, Instagram и Google Maps на альтернативные сервисы, дружелюбные к приватности.", + "description": "Описание расширения." + }, + "nitterInstance": { + "message": "Сервис Nitter", + "description": "Название настройки (в настройках) поля сервиса Nitter." + }, + "invidiousInstance": { + "message": "Сервис Invidious", + "description": "Название настройки (в настройках) поля сервиса Invidious." + }, + "bibliogramInstance": { + "message": "Сервис Bibliogram", + "description": "Название настройки (в настройках) поля сервиса Bibliogram." + }, + "osmInstance": { + "message": "Сервис OpenStreetMap", + "description": "Название настройки (в настройках) поля сервиса OSM." + }, + "disableNitter": { + "message": "Перенаправление на Nitter", + "description": "Название настройки для включения/выключения перенаправления на Nitter (в настройках и всплывающем окне)." + }, + "disableInvidious": { + "message": "Перенаправление на Invidious", + "description": "Название настройки для включения/выключения перенаправления на Invidious redirects option (в настройках и всплывающем окне)." + }, + "disableBibliogram": { + "message": "Перенаправление на Bibliogram", + "description": "Название настройки для включения/выключения перенаправления на Bibliogram (в настройках и всплывающем окне)." + }, + "disableOsm": { + "message": "Перенаправление на OpenStreetMap", + "description": "Название настройки для включения/выключения перенаправления на OSM (в настройках и всплывающем окне)." + }, + "disableReddit": { + "message": "Перенаправление на старый Reddit", + "description": "Название настройки для включения/выключения перенаправления на старый Reddit (в настройках и всплывающем окне)." + }, + "oldRedditView": { + "message": "Вид старого Reddit (настольный или мобильный)", + "description": "Название настройки для 'Вид старого Reddit (настольный или мобильный)' (в настройках)." + }, + "theme": { + "message": "Тема", + "description": "Название настройки для 'Тема' (в настройках)." + }, + "alwaysProxy": { + "message": "Всегда проксировать видео через Invidious", + "description": "Название настройки для 'Всегда проксировать видео через Invidious' (в настройках)." + }, + "onlyEmbeddedVideo": { + "message": "Перенаправлять только встроенные видео на Invidious", + "description": "Название настройки для 'Перенаправлять только встроенные видео на Invidious' (в настройках)." + }, + "videoQuality": { + "message": "Качество видео Invidious", + "description": "Название настройки для 'Качество видео Invidious' (в настройках)." + }, + "removeTwitterSW": { + "message": "Проактивно удалять service worker для Twitter", + "description": "Название настройки для 'Проактивно удалять service worker для Twitter' (в настройках)." + }, + "invidiousDarkMode": { + "message": "Всегда включать темный режим Invidious", + "description": "Название настройки для 'Всегда включать темный режим Invidious' (в настройках)." + }, + "invidiousVolume": { + "message": "Громкость Invidious", + "description": "Название настройки для 'Громкость Invidious' (в настройках)." + }, + "invidiousPlayerStyle": { + "message": "Стиль плеера Invidious", + "description": "Название настройки для 'Стиль плеера Invidious' (в настройках)." + }, + "invidiousSubtitles": { + "message": "Субтитры Invidious - коды языков (разделяются запятой)", + "description": "Название настройки для 'Субтитры Invidious - коды языков (разделяются запятой)' (в настройках)." + }, + "invidiousAutoplay": { + "message": "Автоматически воспроизводить видео Invidious при загрузке", + "description": "Название настройки для 'Автоматически воспроизводить видео Invidious при загрузке' (в настройках)." + }, + "persistInvidiousPrefs": { + "message": "Сохранять настройки Invidious (в файле cookie)", + "description": "Название настройки для 'Сохранять настройки Invidious (в файле cookie)' (в настройках)." + }, + "generalTab": { + "message": "Общие", + "description": "Вкладка 'Общие' (в настройках)." + }, + "advancedTab": { + "message": "Дополнительно", + "description": "Вкладка 'Дополнительно' (в настройках)." + }, + "exceptionsTab": { + "message": "Исключения", + "description": "Вкладка 'Исключения' (в настройках)." + }, + "exceptionsDescriptionP1": { + "message": "Введите URL или регулярное выражение для исключения из перенаправлений.", + "description": "Описание функции 'Исключения' (в настройках)." + }, + "exceptionsDescriptionP2": { + "message": "Все запросы на URL, совпадающие с исключениями, или инициированные с них будут исключены из перенаправлений.", + "description": "Описание функции 'Исключения' (в настройках)." + }, + "exceptionsDescriptionP3": { + "message": "Примечание: Поддерживает регулярные выражения JavaScript, кроме закрывающих обратных слэшей.", + "description": "Описание функции 'Исключения' (в настройках)." + }, + "addException": { + "message": "Добавить исключение", + "description": "Кнопка 'Добавить исключения' (в настройках)." + }, + "moreOptions": { + "message": "Другие настройки", + "description": "Кнопка 'Другие настройки' (во всплывающем окне)." + }, + "privacy": { + "message": "Privacy", + "description": "Название расширения - Privacy (во всплывающем окне)." + }, + "redirect": { + "message": "Redirect", + "description": "Название расширения - Redirect (во всплывающем окне)." + }, + "version": { + "message": "Версия", + "description": "Версия." + }, + "useFreeTube": { + "message": "Использовать FreeTube поверх Invidious при возможности", + "description": "Название настройки для 'Использовать FreeTube поверх Invidious при возможности' (в настройках)." + }, + "nitterRandomPool": { + "message": "Список случайных сервисов Nitter (разделяется запятой)", + "description": "Название настройки для 'Список случайных сервисов Nitter (разделяется запятой)' (в настройках)." + }, + "invidiousRandomPool": { + "message": "Список случайных сервисов Invidious (разделяется запятой)", + "description": "Название настройки для 'Список случайных сервисов Invidious (разделяется запятой)' (в настройках)." + }, + "bibliogramRandomPool": { + "message": "Список случайных сервисов Bibliogram (разделяется запятой)", + "description": "Название настройки для 'Список случайных сервисов Bibliogram (разделяется запятой)' (в настройках)." + } +} diff --git a/src/_locales/ru/store.md b/src/_locales/ru/store.md new file mode 100644 index 00000000..7904efcb --- /dev/null +++ b/src/_locales/ru/store.md @@ -0,0 +1,33 @@ +# Extension Store (AMO & Chrome Web Store) Listing + +## Summary: + +``` +Простое расширение для браузера, которое перенаправляет запросы к Twitter, YouTube, Instagram & Google Maps на альтернативные сервисы, дружелюбные к приватности. +``` + +## Description: + +``` +Перенаправляет запросы к Twitter, YouTube, Instagram, & Google Maps на альтернативные сервисы, дружелюбные к приватности - <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>. + +Позволяет настраивать пользовательские сервисы, включать/выключать все перенаправления и т.д. + +<b>★ Дополнительная информация: ℹ</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> + +Исходный код данного расширения доступен на <a href='https://github.com/SimonBrazell/privacy-redirect'>Github</a>. + +<b>★ Пожертвовать: 👨🏻💻</b> +Если вам нравится это расширение и вы можете помочь финансово, пожалуйста, <a href='https://www.buymeacoffee.com/SimonBrazell'>купите мне кофе</a> ☕ и покажите ваше одобрение и поддержку развития проекта. + +<b>★ Разрешения: ℹ</b> +<ul> + <li>Важно: доступ ко всем сайтам (URL), не только к целевым, требуется для разрешения перенаправления встроенных видео. В данный момент я не знаю, как осуществить перенаправление iframe, буду рад выслушать ваши предложения 🙂</li> +</ul> +``` diff --git a/src/_locales/zh_CN/messages.json b/src/_locales/zh_CN/messages.json new file mode 100644 index 00000000..8c19e2de --- /dev/null +++ b/src/_locales/zh_CN/messages.json @@ -0,0 +1,110 @@ +{ + "extensionName": { + "message": "Privacy Redirect", + "description": "Name of the extension." + }, + "extensionDescription": { + "message": "将 Twitter、YouTube、Instagram 和 Google Maps 重定向至尊重隐私的替代品", + "description": "Description of the extension." + }, + "nitterInstance": { + "message": "Nitter 实例", + "description": "Label for Nitter instance field option (options)." + }, + "invidiousInstance": { + "message": "Invidious 实例", + "description": "Label for Invidious instance field option (options)." + }, + "bibliogramInstance": { + "message": "Bibliogram 实例", + "description": "Label for Bibliogram instance field option (options)." + }, + "osmInstance": { + "message": "OpenStreetMap 实例", + "description": "Label for OSM instance field option (options)." + }, + "disableNitter": { + "message": "Nitter 重定向", + "description": "Label for enable/disable Nitter redirects option (options & pop-up)." + }, + "disableInvidious": { + "message": "Invidious 重定向", + "description": "Label for enable/disable Invidious redirects option (options & pop-up)." + }, + "disableBibliogram": { + "message": "Bibliogram 重定向", + "description": "Label for enable/disable Bibliogram redirects option (options & pop-up)." + }, + "disableOsm": { + "message": "OpenStreetMap 重定向", + "description": "Label for enable/disable OSM redirects option (options & pop-up)." + }, + "alwaysProxy": { + "message": "使用 Invidious 时始终使用视频代理", + "description": "Label for 'Always proxy videos through Invidious' option (options)." + }, + "onlyEmbeddedVideo": { + "message": "只重定向嵌入视频至 Invidious", + "description": "Label for 'Only redirect embedded video to Invidious' option (options)." + }, + "videoQuality": { + "message": "Invidious 视频画质", + "description": "Label for 'Invidious Video Quality' option (options)." + }, + "removeTwitterSW": { + "message": "主动移除 Twitter 后台脚本", + "description": "Label for 'Proactively remove Twitter service worker' option (options)." + }, + "invidiousDarkMode": { + "message": "Invidious 始终使用夜间模式", + "description": "Label for 'Invidious dark mode always on' option (options)." + }, + "persistInvidiousPrefs": { + "message": "以 cookie 形式记住 Invidious 设置", + "description": "Label for 'Persist Invidious preferences (as cookie)' option (options)." + }, + "generalTab": { + "message": "常规", + "description": "General tab (options)." + }, + "advancedTab": { + "message": "高级", + "description": "Advanced tab (options)." + }, + "exceptionsTab": { + "message": "例外", + "description": "Exceptions tab (options)." + }, + "exceptionsDescriptionP1": { + "message": "请输入一个不要重定向 URL 链接或正则表达式。", + "description": "A description of the 'Exceptions' feature paragraph 1 (options)." + }, + "exceptionsDescriptionP2": { + "message": "若发起请求或访问的页面 URL 符合任一表达式,则插件将不会将其重定向。", + "description": "A description of the 'Exceptions' feature paragraph 2 (options)." + }, + "exceptionsDescriptionP3": { + "message": "注:支持 JavaScript 正则表达式,且无须用正斜杠始末。", + "description": "A description of the 'Exceptions' feature paragraph 3 (options)." + }, + "addException": { + "message": "添加例外", + "description": "'Add Exceptions' button (options)." + }, + "moreOptions": { + "message": "更多设置", + "description": "More Options button (pop-up)." + }, + "privacy": { + "message": "Privacy", + "description": "Extension title - Privacy (pop-up)." + }, + "redirect": { + "message": "Redirect", + "description": "Extension title - Redirect (pop-up)." + }, + "version": { + "message": "版本", + "description": "Version" + } +} diff --git a/src/_locales/zh_CN/store.md b/src/_locales/zh_CN/store.md new file mode 100644 index 00000000..964debf6 --- /dev/null +++ b/src/_locales/zh_CN/store.md @@ -0,0 +1,33 @@ +# Extension Store (AMO & Chrome Web Store) Listing + +## Summary: + +``` +一个简单的扩展程序来将 Twitter、YouTube、Instagram 和 Google地图重定向至尊重隐私的替代品。 +``` + +## Description: + +``` +将 Twitter、YouTube、Instagram 和 Google地图重定向至尊重隐私的替代品: <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>。 + +允许自定义实例,开关重定向等设定。 + +<b>★ 更多详细:ℹ️</b> +<ul> + <li><a href='https://github.com/zedeus/nitter#nitter-wip'>Nitter</a></li> + <li><a href='https://github.com/iv-org/invidious#invidious'>Invidious</a></li> + <li><a href='https://sr.ht/~cadence/bibliogram/#a-hrefhttpsbibliogramartbibliograma'>Bibliogram</a></li> + <li><a href='https://wiki.openstreetmap.org/'>OpenStreetMap</a></li> +</ul> + +本扩展的源代码可在 <a href='https://github.com/SimonBrazell/privacy-redirect'>Github</a> 上查看。 + +<b>★ 捐赠:👨🏻💻</b> +若您喜欢本扩展程序,且有闲钱,不妨<a href='https://www.buymeacoffee.com/SimonBrazell'>给我买杯咖啡</a>来表达您对这个项目的感谢与支持。 + +<b>★ 权限:ℹ️</b> +<ul> + <li>请注意,您需授予查看所有 URL(不只是需要重定向的URL)网站导向活动的权限,以来重定向嵌入的视频。目前我不知道其他重定向iframe的方法,有能者请解囊相助! 🙂</li> +</ul> +``` diff --git a/src/assets/javascripts/helpers/google-search.js b/src/assets/javascripts/helpers/google-search.js index c83d7c98..6ac12400 100644 --- a/src/assets/javascripts/helpers/google-search.js +++ b/src/assets/javascripts/helpers/google-search.js @@ -4,6 +4,13 @@ const redirects = [ { link: "https://startpage.com", q: "/search/" }, { link: "https://www.qwant.com", q: "/" }, { link: "https://www.mojeek.com", q: "/search" }, + { link: "https://search.snopyta.org", q: "/" }, + { link: "https://searx.info", q: "/" }, + { link: "https://searx.be", q: "/" }, + { link: "https://search.disroot.org", q: "/" }, + { link: "https://searx.tuxcloud.net", q: "/" }, + { link: "https://searx.ninja", q: "/" }, + { link: "https://tromland.org/searx", q: "/search" }, ]; export default { diff --git a/src/assets/javascripts/helpers/reddit.js b/src/assets/javascripts/helpers/reddit.js index 6cf62bc7..7c89a258 100644 --- a/src/assets/javascripts/helpers/reddit.js +++ b/src/assets/javascripts/helpers/reddit.js @@ -5,19 +5,19 @@ const targets = [ "amp.reddit.com", ]; const redirects = [ - "https://old.reddit.com", // desktop - "https://i.reddit.com", // mobile - // teddit: privacy w/ old UI - "https://teddit.net", - "https://teddit.ggc-project.de", - "https://teddit.kavin.rocks", - "https://snew.notabug.io", // anti-censorship // libreddit: privacy w/ modern UI "https://libredd.it", "https://libreddit.spike.codes", "https://libreddit.kavin.rocks", "https://libreddit.insanity.wtf", "https://libreddit.dothq.co", + // teddit: privacy w/ old UI + "https://teddit.net", + "https://teddit.ggc-project.de", + "https://teddit.kavin.rocks", + "https://old.reddit.com", // desktop + "https://i.reddit.com", // mobile + "https://snew.notabug.io", // anti-censorship ]; const bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/; diff --git a/src/assets/javascripts/remove-twitter-sw.js b/src/assets/javascripts/remove-twitter-sw.js index c39b4c9e..e6ff0ae9 100644 --- a/src/assets/javascripts/remove-twitter-sw.js +++ b/src/assets/javascripts/remove-twitter-sw.js @@ -1,5 +1,26 @@ "use strict"; +const nitterInstances = [ + "https://nitter.net", + "https://nitter.snopyta.org", + "https://nitter.42l.fr", + "https://nitter.nixnet.services", + "https://nitter.13ad.de", + "https://nitter.pussthecat.org", + "https://nitter.mastodont.cat", + "https://nitter.dark.fail", + "https://nitter.tedomum.net", + "https://nitter.cattube.org", + "https://nitter.fdn.fr", + "https://nitter.1d4.us", + "https://nitter.kavin.rocks", + "https://tweet.lambda.dance", + "https://nitter.cc", + "https://nitter.weaponizedhumiliation.com", + "https://nitter.vxempire.xyz", + "https://nitter.unixfox.eu", +]; + let disableNitter; let nitterInstance; let redirectBypassFlag; @@ -7,83 +28,161 @@ let exceptions; window.browser = window.browser || window.chrome; -Promise.all([ - import(browser.extension.getURL("src/assets/javascripts/helpers/common.js")), - import(browser.extension.getURL("src/assets/javascripts/helpers/twitter.js")), -]).then( - (helpers) => { - let commonHelper; - let twitterHelper; - [commonHelper, twitterHelper] = helpers; +function getRandomInstance() { + return nitterInstances[~~(nitterInstances.length * Math.random())]; +} - function isNotException(url) { - return !exceptions.some((regex) => regex.test(url.href)); - } +function isNotException(url) { + return !exceptions.some((regex) => regex.test(url.href)); +} - function shouldRedirect(url) { - return ( - !redirectBypassFlag && - isNotException(url) && - !disableNitter && - url.host !== nitterInstance && - !url.pathname.includes("/home") - ); - } +function shouldRedirect(url) { + return ( + !redirectBypassFlag && + isNotException(url) && + !disableNitter && + url.host !== nitterInstance && + !url.pathname.includes("/home") + ); +} - function redirectTwitter(url) { - if (url.host.split(".")[0] === "pbs") { - return `${nitterInstance}/pic/${encodeURIComponent(url.href)}`; - } else if (url.host.split(".")[0] === "video") { - return `${nitterInstance}/gif/${encodeURIComponent(url.href)}`; - } else { - return `${nitterInstance}${url.pathname}${url.search}`; - } - } +function redirectTwitter(url) { + if (url.host.split(".")[0] === "pbs") { + return `${nitterInstance}/pic/${encodeURIComponent(url.href)}`; + } else if (url.host.split(".")[0] === "video") { + return `${nitterInstance}/gif/${encodeURIComponent(url.href)}`; + } else { + return `${nitterInstance}${url.pathname}${url.search}`; + } +} - browser.storage.sync.get( - [ - "nitterInstance", - "disableNitter", - "removeTwitterSW", - "redirectBypassFlag", - "exceptions", - ], - (result) => { - redirectBypassFlag = result.redirectBypassFlag; - browser.storage.sync.set({ - redirectBypassFlag: false, - }); - if (!result.removeTwitterSW) { - disableNitter = result.disableNitter; - nitterInstance = - result.nitterInstance || - commonHelper.default.getRandomInstance( - twitterHelper.default.redirects - ); - exceptions = result.exceptions - ? result.exceptions.map((e) => { - return new RegExp(e); - }) - : []; - navigator.serviceWorker.getRegistrations().then((registrations) => { - for (let registration of registrations) { - if (registration.scope === "https://twitter.com/") { - registration.unregister(); - console.log("Unregistered Twitter SW", registration); - } - } - }); - const url = new URL(window.location); - if (shouldRedirect(url)) { - const redirect = redirectTwitter(url); - console.info("Redirecting", `"${url.href}"`, "=>", `"${redirect}"`); - window.location = redirect; +browser.storage.sync.get( + [ + "nitterInstance", + "disableNitter", + "removeTwitterSW", + "redirectBypassFlag", + "exceptions", + ], + (result) => { + redirectBypassFlag = result.redirectBypassFlag; + browser.storage.sync.set({ + redirectBypassFlag: false, + }); + if (!result.removeTwitterSW) { + disableNitter = result.disableNitter; + nitterInstance = result.nitterInstance || getRandomInstance(); + exceptions = result.exceptions + ? result.exceptions.map((e) => { + return new RegExp(e); + }) + : []; + navigator.serviceWorker.getRegistrations().then((registrations) => { + for (let registration of registrations) { + if (registration.scope === "https://twitter.com/") { + registration.unregister(); + console.log("Unregistered Twitter SW", registration); } } + }); + const url = new URL(window.location); + if (shouldRedirect(url)) { + const redirect = redirectTwitter(url); + console.info("Redirecting", `"${url.href}"`, "=>", `"${redirect}"`); + window.location = redirect; } - ); - }, - (error) => { - console.error(error); + } } ); + +// Keeping this here until https://bugzilla.mozilla.org/show_bug.cgi?id=1536094 is fixed... +// +//"use strict"; +// +//let disableNitter; +//let nitterInstance; +//let redirectBypassFlag; +//let exceptions; +// +//window.browser = window.browser || window.chrome; +// +//Promise.all([ +// import(browser.extension.getURL("src/assets/javascripts/helpers/common.js")), +// import(browser.extension.getURL("src/assets/javascripts/helpers/twitter.js")), +//]).then( +// (helpers) => { +// let commonHelper; +// let twitterHelper; +// [commonHelper, twitterHelper] = helpers; +// +// function isNotException(url) { +// return !exceptions.some((regex) => regex.test(url.href)); +// } +// +// function shouldRedirect(url) { +// return ( +// !redirectBypassFlag && +// isNotException(url) && +// !disableNitter && +// url.host !== nitterInstance && +// !url.pathname.includes("/home") +// ); +// } +// +// function redirectTwitter(url) { +// if (url.host.split(".")[0] === "pbs") { +// return `${nitterInstance}/pic/${encodeURIComponent(url.href)}`; +// } else if (url.host.split(".")[0] === "video") { +// return `${nitterInstance}/gif/${encodeURIComponent(url.href)}`; +// } else { +// return `${nitterInstance}${url.pathname}${url.search}`; +// } +// } +// +// browser.storage.sync.get( +// [ +// "nitterInstance", +// "disableNitter", +// "removeTwitterSW", +// "redirectBypassFlag", +// "exceptions", +// ], +// (result) => { +// redirectBypassFlag = result.redirectBypassFlag; +// browser.storage.sync.set({ +// redirectBypassFlag: false, +// }); +// if (!result.removeTwitterSW) { +// disableNitter = result.disableNitter; +// nitterInstance = +// result.nitterInstance || +// commonHelper.default.getRandomInstance( +// twitterHelper.default.redirects +// ); +// exceptions = result.exceptions +// ? result.exceptions.map((e) => { +// return new RegExp(e); +// }) +// : []; +// navigator.serviceWorker.getRegistrations().then((registrations) => { +// for (let registration of registrations) { +// if (registration.scope === "https://twitter.com/") { +// registration.unregister(); +// console.log("Unregistered Twitter SW", registration); +// } +// } +// }); +// const url = new URL(window.location); +// if (shouldRedirect(url)) { +// const redirect = redirectTwitter(url); +// console.info("Redirecting", `"${url.href}"`, "=>", `"${redirect}"`); +// window.location = redirect; +// } +// } +// } +// ); +// }, +// (error) => { +// console.error(error); +// } +//); diff --git a/src/manifest.json b/src/manifest.json new file mode 100644 index 00000000..5f9ff8c6 --- /dev/null +++ b/src/manifest.json @@ -0,0 +1,71 @@ +{ + "name": "__MSG_extensionName__", + "description": "__MSG_extensionDescription__", + "version": "1.1.45", + "manifest_version": 2, + "background": { + "page": "pages/background/background.html", + "persistent": true + }, + "default_locale": "en", + "icons": { + "16": "assets/images/icon16.png", + "32": "assets/images/icon32.png", + "48": "assets/images/icon48.png", + "128": "assets/images/icon128.png" + }, + "permissions": ["storage", "webRequest", "webRequestBlocking", "<all_urls>"], + "browser_action": { + "default_title": "Privacy Redirect", + "default_popup": "pages/popup/popup.html", + "default_icon": { + "16": "assets/images/icon16.png", + "32": "assets/images/icon32.png", + "48": "assets/images/icon48.png", + "128": "assets/images/icon128.png" + } + }, + "content_scripts": [ + { + "matches": [ + "*://twitter.com/*", + "*://www.twitter.com/*", + "*://mobile.twitter.com/*", + "*://pbs.twimg.com/*", + "*://video.twimg.com/*" + ], + "js": ["assets/javascripts/remove-twitter-sw.js"], + "run_at": "document_start" + }, + { + "matches": [ + "*://invidious.snopyta.org/*", + "*://invidious.xyz/*", + "*://invidious.kavin.rocks/*", + "*://tube.connect.cafe/*", + "*://invidious.zapashcanon.fr/*", + "*://invidiou.site/*", + "*://vid.mint.lgbt/*", + "*://invidious.site/*", + "*://yewtu.be/*", + "*://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion/*", + "*://qklhadlycap4cnod.onion/*", + "*://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion/*", + "*://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion/*" + ], + "js": ["assets/javascripts/persist-invidious-prefs.js"], + "run_at": "document_start" + } + ], + "options_ui": { + "page": "pages/options/options.html", + "open_in_tab": false + }, + "web_accessible_resources": ["assets/javascripts/helpers/*"], + "browser_specific_settings": { + "gecko": { + "id": "{b7f9d2cd-d772-4302-8c3f-eb941af36f76}", + "strict_min_version": "60.0" + } + } +} diff --git a/src/pages/background/background.html b/src/pages/background/background.html index 6ce1fdc9..55f5b619 100644 --- a/src/pages/background/background.html +++ b/src/pages/background/background.html @@ -1,2 +1,7 @@ <!DOCTYPE html> -<script type="module" src="background.js"></script> +<html> + <head> + <meta charset="utf-8" /> + <script type="module" src="background.js"></script> + </head> +</html> diff --git a/src/pages/options/options.html b/src/pages/options/options.html index af7bd41a..dbb1406e 100644 --- a/src/pages/options/options.html +++ b/src/pages/options/options.html @@ -211,7 +211,7 @@ <input id="reddit-instance" type="url" - placeholder="https://old.reddit.com" + placeholder="https://libredd.it" /> </div> </section> diff --git a/src/pages/options/options.js b/src/pages/options/options.js index a6980734..0f785f6e 100644 --- a/src/pages/options/options.js +++ b/src/pages/options/options.js @@ -467,11 +467,15 @@ function autocomplete(input, list) { } } function getItem(item, val) { - let div = document.createElement("div"); - let html = `<strong>${item.substr(0, val.length)}</strong>${item.substr( - val.length - )}<input type='hidden' value='${item}'>`; - div.appendChild(parser.parseFromString(html, "text/html").documentElement); + const div = document.createElement("div"); + const strong = document.createElement("strong"); + strong.textContent = item.substr(0, val.length); + div.innerText = item.substr(val.length); + const hiddenInput = document.createElement("input"); + hiddenInput.type = "hidden"; + hiddenInput.value = item; + div.prepend(strong); + div.appendChild(hiddenInput); div.addEventListener("click", function (e) { input.value = e.target.getElementsByTagName("input")[0].value; input.dispatchEvent(new Event("input")); diff --git a/src/web-ext-config.js b/src/web-ext-config.js new file mode 100644 index 00000000..885e79aa --- /dev/null +++ b/src/web-ext-config.js @@ -0,0 +1,8 @@ +module.exports = { + ignoreFiles: [ + "assets/images/Screen Shot*.png", + "assets/images/buy-me-a-coffee.png", + "assets/images/logo*.png", + "assets/images/badge*.png", + ], +}; |