From 12a636a0eb28a8821f11abf1fde665dfb8af405b Mon Sep 17 00:00:00 2001 From: Hin Weisner Date: Sun, 26 Jun 2022 16:16:19 +0200 Subject: Added translation using Weblate (Spanish) --- src/_locales/es/messages.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/_locales/es/messages.json (limited to 'src/_locales') diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/src/_locales/es/messages.json @@ -0,0 +1 @@ +{} -- cgit 1.4.1 From 88a122d2d6e094754a1a3d5667e6436ff5fcf768 Mon Sep 17 00:00:00 2001 From: Hin Weisner Date: Sun, 26 Jun 2022 14:16:51 +0000 Subject: Translated using Weblate (Spanish) Currently translated at 1.8% (1 of 55 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/es/ --- src/_locales/es/messages.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/_locales') diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json index 0967ef42..ee8146c8 100644 --- a/src/_locales/es/messages.json +++ b/src/_locales/es/messages.json @@ -1 +1,6 @@ -{} +{ + "extensionName": { + "message": "LibRedirect", + "description": "name of the extension" + } +} -- cgit 1.4.1 From ac1dd0fec7b2768e4cc3ed2c03170d241c185abb Mon Sep 17 00:00:00 2001 From: Pixelcode Date: Sun, 26 Jun 2022 19:04:43 +0000 Subject: Translated using Weblate (German) Currently translated at 100.0% (55 of 55 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/de/ --- src/_locales/de/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/_locales') diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json index bd9cc42f..55bb0dc4 100644 --- a/src/_locales/de/messages.json +++ b/src/_locales/de/messages.json @@ -96,7 +96,7 @@ "description": "used in the settings page" }, "autoRedirect": { - "message": "Automatisch Instanzen meiden, die offline sind", + "message": "Automatisch von Offline-Instanzen zu Online-Instanzen wechseln", "description": "used in the settings page" }, "exceptions": { -- cgit 1.4.1 From e9c7dbc4f512cf37f23cc0c5ff44b5031c5fe535 Mon Sep 17 00:00:00 2001 From: Hin Weisner Date: Sun, 26 Jun 2022 14:21:28 +0000 Subject: Translated using Weblate (Spanish) Currently translated at 100.0% (55 of 55 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/es/ --- src/_locales/es/messages.json | 209 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json index ee8146c8..07ea98c3 100644 --- a/src/_locales/es/messages.json +++ b/src/_locales/es/messages.json @@ -2,5 +2,214 @@ "extensionName": { "message": "LibRedirect", "description": "name of the extension" + }, + "switchInstance": { + "message": "Cambiar instancia", + "description": "used in manifest.json as shortcut description" + }, + "settings": { + "message": "Ajustes", + "description": "used in the popup" + }, + "general": { + "message": "General", + "description": "used in the settings page" + }, + "translate": { + "message": "Traductor", + "description": "used in the settings page" + }, + "search": { + "message": "Búsqueda", + "description": "used in the settings page" + }, + "ytmusic": { + "message": "YT Music", + "description": "used in the settings page" + }, + "wikipedia": { + "message": "Wikipedia", + "description": "used in the settings page" + }, + "medium": { + "message": "Medium", + "description": "used in the settings page" + }, + "tor": { + "message": "Tor", + "description": "used in the settings page" + }, + "theme": { + "message": "Tema", + "description": "used in the settings page" + }, + "light": { + "message": "Claro", + "description": "used in the settings page" + }, + "autoRedirect": { + "message": "Redirigir automáticamente las instancias offline a las online", + "description": "used in the settings page" + }, + "exceptions": { + "message": "Excepciones", + "description": "used in the settings page" + }, + "importSettings": { + "message": "Importar Ajustes", + "description": "used in the settings page" + }, + "exportSettings": { + "message": "Exportar Ajustes", + "description": "used in the settings page" + }, + "customPopup": { + "message": "Personalizar Ventana Emergente", + "description": "used in the settings page" + }, + "enable": { + "message": "Activar", + "description": "used in the settings page" + }, + "protocol": { + "message": "Protocolo", + "description": "used in the settings page" + }, + "normal": { + "message": "Normal", + "description": "used in the settings page" + }, + "frontend": { + "message": "Frontend", + "description": "used in the settings page" + }, + "embeddedVids": { + "message": "Frontend para Videos Incrustados", + "description": "used in the settings page" + }, + "onlyEmbedded": { + "message": "solo incrustados", + "description": "used in the settings page" + }, + "copyRaw": { + "message": "Copiar Original" + }, + "copied": { + "message": "Copiado" + }, + "unifySettings": { + "message": "Unificar Ajustes" + }, + "lbry": { + "message": "LBRY" + }, + "i2p": { + "message": "I2P" + }, + "instanceOffline": { + "message": "Esta instancia está offline, serás redirigido/a luego de ", + "description": "used in instance_offline.html" + }, + "testInstancesLatency": { + "message": "Probar Latencia de las Instancias" + }, + "youtube": { + "message": "YouTube", + "description": "used in the settings page" + }, + "extensionDescription": { + "message": "Una extensión web que redirige sitios populares a frontends y backends alternativos que respetan la privacidad", + "description": "description of the extension" + }, + "maps": { + "message": "Mapas", + "description": "used in the settings page" + }, + "sendFiles": { + "message": "Enviar Archivos", + "description": "used in the settings page" + }, + "twitter": { + "message": "Twitter", + "description": "used in the settings page" + }, + "reddit": { + "message": "Reddit", + "description": "used in the settings page" + }, + "instagram": { + "message": "Instagram", + "description": "used in the settings page" + }, + "tiktok": { + "message": "TikTok", + "description": "used in the settings page" + }, + "imgur": { + "message": "Imgur", + "description": "used in the settings page" + }, + "resetSettings": { + "message": "Restablecer Ajustes", + "description": "used in the settings page" + }, + "updateInstances": { + "message": "Actualizar Instancias", + "description": "used in the settings page" + }, + "defaultInstances": { + "message": "Instancias Predeterminadas", + "description": "used in the settings page" + }, + "peertube": { + "message": "PeerTube", + "description": "used in the settings page" + }, + "system": { + "message": "Sistema", + "description": "used in the settings page" + }, + "dark": { + "message": "Oscuro", + "description": "used in the settings page" + }, + "customInstances": { + "message": "Instancias Personalizadas", + "description": "used in the settings page" + }, + "notFullyPrivate": { + "message": "Este no es un frontend completamente privado." + }, + "toggleAll": { + "message": "Alternar todo", + "description": "used in the settings page" + }, + "onlyNotEmbedded": { + "message": "solo los no incrustados", + "description": "used in the settings page" + }, + "instanceIsOff": { + "message": "La instancia está offline", + "description": "used in instance_offline.html" + }, + "searchNote": { + "message": "Nota: Utilice la búsqueda en todo su potencial haciendo de LibRedirect su motor de búsqueda predeterminado.", + "description": "used in the settings page" + }, + "redirectType": { + "message": "Tipo de Redirección", + "description": "used in the settings page" + }, + "both": { + "message": "ambos", + "description": "used in the settings page" + }, + "cancel": { + "message": "Cancelar", + "description": "used in instance_offline.html" + }, + "redirectionCanceled": { + "message": "Redirección cancelada", + "description": "used in instance_offline.js" } } -- cgit 1.4.1 From 3626e8e947673b3b6820ae2395adea111e641636 Mon Sep 17 00:00:00 2001 From: Sangha Lee Date: Mon, 4 Jul 2022 16:09:00 +0200 Subject: Added translation using Weblate (Korean) --- src/_locales/ko/messages.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/_locales/ko/messages.json (limited to 'src/_locales') diff --git a/src/_locales/ko/messages.json b/src/_locales/ko/messages.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/src/_locales/ko/messages.json @@ -0,0 +1 @@ +{} -- cgit 1.4.1 From 6f07538cbe9ebc0b9f4c3b1863aaccca8b8e56ba Mon Sep 17 00:00:00 2001 From: Sangha Lee Date: Mon, 4 Jul 2022 14:09:12 +0000 Subject: Translated using Weblate (Korean) Currently translated at 92.7% (51 of 55 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/ko/ --- src/_locales/ko/messages.json | 200 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 199 insertions(+), 1 deletion(-) (limited to 'src/_locales') diff --git a/src/_locales/ko/messages.json b/src/_locales/ko/messages.json index 0967ef42..ad48864c 100644 --- a/src/_locales/ko/messages.json +++ b/src/_locales/ko/messages.json @@ -1 +1,199 @@ -{} +{ + "extensionName": { + "message": "LibRedirect", + "description": "name of the extension" + }, + "switchInstance": { + "message": "인스턴스 바꾸기", + "description": "used in manifest.json as shortcut description" + }, + "settings": { + "message": "설정", + "description": "used in the popup" + }, + "general": { + "message": "일반", + "description": "used in the settings page" + }, + "search": { + "message": "검색", + "description": "used in the settings page" + }, + "translate": { + "message": "번역", + "description": "used in the settings page" + }, + "ytmusic": { + "message": "YT Music", + "description": "used in the settings page" + }, + "imgur": { + "message": "Imgur", + "description": "used in the settings page" + }, + "wikipedia": { + "message": "Wikipedia", + "description": "used in the settings page" + }, + "peertube": { + "message": "PeerTube", + "description": "used in the settings page" + }, + "medium": { + "message": "Medium", + "description": "used in the settings page" + }, + "tor": { + "message": "Tor", + "description": "used in the settings page" + }, + "theme": { + "message": "테마", + "description": "used in the settings page" + }, + "system": { + "message": "시스템", + "description": "used in the settings page" + }, + "light": { + "message": "밝음", + "description": "used in the settings page" + }, + "updateInstances": { + "message": "인스터스 업데이트", + "description": "used in the settings page" + }, + "importSettings": { + "message": "설정 불러오기", + "description": "used in the settings page" + }, + "exportSettings": { + "message": "설정 내보내기", + "description": "used in the settings page" + }, + "enable": { + "message": "활성화", + "description": "used in the settings page" + }, + "protocol": { + "message": "프로토콜", + "description": "used in the settings page" + }, + "normal": { + "message": "일반", + "description": "used in the settings page" + }, + "defaultInstances": { + "message": "기본 인스턴스", + "description": "used in the settings page" + }, + "customInstances": { + "message": "사용자 인스턴스", + "description": "used in the settings page" + }, + "frontend": { + "message": "프론트엔드", + "description": "used in the settings page" + }, + "youtube": { + "message": "YouTube", + "description": "used in the settings page" + }, + "testInstancesLatency": { + "message": "인스턴스 지연 시간 시험" + }, + "redirectType": { + "message": "리다이렉트 종류", + "description": "used in the settings page" + }, + "onlyEmbedded": { + "message": "임베디드 된 것만", + "description": "used in the settings page" + }, + "onlyNotEmbedded": { + "message": "임베디드 안된 것만", + "description": "used in the settings page" + }, + "instanceOffline": { + "message": "이 인스턴스는 오프라인입니다, 다음 초 후에 리다이렉트됩니다: ", + "description": "used in instance_offline.html" + }, + "notFullyPrivate": { + "message": "완전한 개인 프론트엔드가 아닙니다." + }, + "searchNote": { + "message": "안내: LibRedirect를 기본 검색 엔진으로 만들면 완벽히 사용할 수 있습니다.", + "description": "used in the settings page" + }, + "both": { + "message": "둘 다", + "description": "used in the settings page" + }, + "embeddedVids": { + "message": "임베디드된 동영상 프론트엔드", + "description": "used in the settings page" + }, + "unifySettings": { + "message": "설정 통일하기" + }, + "maps": { + "message": "지도", + "description": "used in the settings page" + }, + "sendFiles": { + "message": "파일 전송", + "description": "used in the settings page" + }, + "instagram": { + "message": "Instagram", + "description": "used in the settings page" + }, + "exceptions": { + "message": "예외", + "description": "used in the settings page" + }, + "resetSettings": { + "message": "설정 초기화", + "description": "used in the settings page" + }, + "customPopup": { + "message": "팝업 사용자 설정", + "description": "used in the settings page" + }, + "dark": { + "message": "어두움", + "description": "used in the settings page" + }, + "autoRedirect": { + "message": "오프라인 인스터스를 온라인으로 자동 리다이렉트", + "description": "used in the settings page" + }, + "toggleAll": { + "message": "전체 전환", + "description": "used in the settings page" + }, + "instanceIsOff": { + "message": "인스턴스 오프라인", + "description": "used in instance_offline.html" + }, + "lbry": { + "message": "LBRY" + }, + "i2p": { + "message": "I2P" + }, + "cancel": { + "message": "취소", + "description": "used in instance_offline.html" + }, + "redirectionCanceled": { + "message": "리다이렉션 취소됨", + "description": "used in instance_offline.js" + }, + "copyRaw": { + "message": "Raw 복사" + }, + "copied": { + "message": "복사됨" + } +} -- cgit 1.4.1 From 4876412c431a4aa8705cbdc7da47073c5f5114fe Mon Sep 17 00:00:00 2001 From: Xosé M Date: Tue, 12 Jul 2022 15:34:56 +0000 Subject: Translated using Weblate (Galician) Currently translated at 100.0% (55 of 55 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/gl/ --- src/_locales/gl/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/gl/messages.json b/src/_locales/gl/messages.json index 3468e337..173af4bd 100644 --- a/src/_locales/gl/messages.json +++ b/src/_locales/gl/messages.json @@ -208,5 +208,8 @@ }, "i2p": { "message": "I2P" + }, + "unifySettings": { + "message": "Unificar Axustes" } } -- cgit 1.4.1 From 9059cef16974612f21ccef147ce92c60bc86da72 Mon Sep 17 00:00:00 2001 From: ivvfgkvvuvbxeooq pjgbdpqjufigqykp Date: Wed, 13 Jul 2022 16:44:35 +0000 Subject: Translated using Weblate (Polish) Currently translated at 100.0% (56 of 56 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/pl/ --- src/_locales/pl/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json index 136f0de5..8ee06cc0 100644 --- a/src/_locales/pl/messages.json +++ b/src/_locales/pl/messages.json @@ -211,5 +211,8 @@ "customPopup": { "message": "Dostosuj Wyskakujące Okienko", "description": "used in the settings page" + }, + "loki": { + "message": "Lokinet" } } -- cgit 1.4.1 From c3f4003922a2421861d609d61cd4f8591da3d016 Mon Sep 17 00:00:00 2001 From: Oğuz Ersen Date: Thu, 14 Jul 2022 05:21:29 +0000 Subject: Translated using Weblate (Turkish) Currently translated at 100.0% (56 of 56 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/tr/ --- src/_locales/tr/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/tr/messages.json b/src/_locales/tr/messages.json index 3148662e..82bf8778 100644 --- a/src/_locales/tr/messages.json +++ b/src/_locales/tr/messages.json @@ -211,5 +211,8 @@ "normal": { "message": "Normal", "description": "used in the settings page" + }, + "loki": { + "message": "Lokinet" } } -- cgit 1.4.1 From 7d698546fd411c52c1cabfef955aa29629816cf4 Mon Sep 17 00:00:00 2001 From: Xosé M Date: Sat, 16 Jul 2022 10:00:09 +0000 Subject: Translated using Weblate (Galician) Currently translated at 100.0% (56 of 56 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/gl/ --- src/_locales/gl/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/gl/messages.json b/src/_locales/gl/messages.json index 173af4bd..fba02255 100644 --- a/src/_locales/gl/messages.json +++ b/src/_locales/gl/messages.json @@ -211,5 +211,8 @@ }, "unifySettings": { "message": "Unificar Axustes" + }, + "loki": { + "message": "Lokinet" } } -- cgit 1.4.1 From f5abf63c3bed39e437b750a3775d0c33922f739e Mon Sep 17 00:00:00 2001 From: Nikita Epifanov Date: Mon, 18 Jul 2022 14:12:52 +0200 Subject: Added translation using Weblate (Russian) --- src/_locales/ru/messages.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/_locales/ru/messages.json (limited to 'src/_locales') diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/src/_locales/ru/messages.json @@ -0,0 +1 @@ +{} -- cgit 1.4.1 From f77e80392281af8024fdee1cb3be36979689c936 Mon Sep 17 00:00:00 2001 From: "J. Lavoie" Date: Mon, 18 Jul 2022 22:50:29 +0000 Subject: Translated using Weblate (French) Currently translated at 100.0% (56 of 56 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/fr/ --- src/_locales/fr/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json index e758bacc..42c3d8dc 100644 --- a/src/_locales/fr/messages.json +++ b/src/_locales/fr/messages.json @@ -211,5 +211,8 @@ "ytmusic": { "message": "YT Music", "description": "used in the settings page" + }, + "loki": { + "message": "Lokinet" } } -- cgit 1.4.1 From 617e2c4fefbd9172089c8cbaf9eddbfa95c232e5 Mon Sep 17 00:00:00 2001 From: Nikita Epifanov Date: Mon, 18 Jul 2022 12:14:28 +0000 Subject: Translated using Weblate (Russian) Currently translated at 96.4% (54 of 56 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/ru/ --- src/_locales/ru/messages.json | 219 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 218 insertions(+), 1 deletion(-) (limited to 'src/_locales') diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json index 0967ef42..04afb07a 100644 --- a/src/_locales/ru/messages.json +++ b/src/_locales/ru/messages.json @@ -1 +1,218 @@ -{} +{ + "extensionDescription": { + "message": "Веб-расширение, которое перенаправляет популярные сайты на альтернативные фронтенды и бэкенды, обеспечивающие конфиденциальность", + "description": "description of the extension" + }, + "extensionName": { + "message": "LibRedirect", + "description": "name of the extension" + }, + "protocol": { + "message": "Протокол", + "description": "used in the settings page" + }, + "normal": { + "message": "Нормальный", + "description": "used in the settings page" + }, + "settings": { + "message": "Настройки", + "description": "used in the popup" + }, + "general": { + "message": "Общее", + "description": "used in the settings page" + }, + "search": { + "message": "Поиск", + "description": "used in the settings page" + }, + "translate": { + "message": "Перевод", + "description": "used in the settings page" + }, + "maps": { + "message": "Карты", + "description": "used in the settings page" + }, + "sendFiles": { + "message": "Отправка файлов", + "description": "used in the settings page" + }, + "youtube": { + "message": "YouTube", + "description": "used in the settings page" + }, + "tiktok": { + "message": "TikTok", + "description": "used in the settings page" + }, + "ytmusic": { + "message": "YT Music", + "description": "used in the settings page" + }, + "imgur": { + "message": "Imgur", + "description": "used in the settings page" + }, + "wikipedia": { + "message": "Wikipedia", + "description": "used in the settings page" + }, + "peertube": { + "message": "PeerTube", + "description": "used in the settings page" + }, + "importSettings": { + "message": "Импорт настроек", + "description": "used in the settings page" + }, + "exportSettings": { + "message": "Экспорт настроек", + "description": "used in the settings page" + }, + "resetSettings": { + "message": "Сброс настроек", + "description": "used in the settings page" + }, + "customPopup": { + "message": "Настроить всплывающее окно", + "description": "used in the settings page" + }, + "redirectType": { + "message": "Тип перенаправления", + "description": "used in the settings page" + }, + "both": { + "message": "оба", + "description": "used in the settings page" + }, + "onlyEmbedded": { + "message": "только встроенные", + "description": "used in the settings page" + }, + "onlyNotEmbedded": { + "message": "только не встроеные", + "description": "used in the settings page" + }, + "instanceOffline": { + "message": "Этот экземпляр находится в автономном режиме, вы будете перенаправлены после ", + "description": "used in instance_offline.html" + }, + "cancel": { + "message": "Отмена", + "description": "used in instance_offline.html" + }, + "instanceIsOff": { + "message": "Экземпляр не в сети", + "description": "used in instance_offline.html" + }, + "redirectionCanceled": { + "message": "Перенаправление отменено", + "description": "used in instance_offline.js" + }, + "switchInstance": { + "message": "Переключить экземпляр", + "description": "used in manifest.json as shortcut description" + }, + "autoRedirect": { + "message": "Автоматическое перенаправление на экземпляров находящихся в сети", + "description": "used in the settings page" + }, + "updateInstances": { + "message": "Обновить экземпляры", + "description": "used in the settings page" + }, + "defaultInstances": { + "message": "Экземпляры по умолчанию", + "description": "used in the settings page" + }, + "customInstances": { + "message": "Пользовательские экземпляры", + "description": "used in the settings page" + }, + "embeddedVids": { + "message": "Фронтенд со встроенным видео", + "description": "used in the settings page" + }, + "copied": { + "message": "Скопировано" + }, + "lbry": { + "message": "LBRY" + }, + "i2p": { + "message": "I2P" + }, + "loki": { + "message": "Lokinet" + }, + "testInstancesLatency": { + "message": "Тестирование задержки экземпляров" + }, + "copyRaw": { + "message": "Скопировать напрямую" + }, + "unifySettings": { + "message": "Унифицировать настройки" + }, + "instagram": { + "message": "Instagram", + "description": "used in the settings page" + }, + "enable": { + "message": "Включить", + "description": "used in the settings page" + }, + "twitter": { + "message": "Twitter", + "description": "used in the settings page" + }, + "system": { + "message": "Системная", + "description": "used in the settings page" + }, + "exceptions": { + "message": "Исключения", + "description": "used in the settings page" + }, + "reddit": { + "message": "Reddit", + "description": "used in the settings page" + }, + "tor": { + "message": "Tor", + "description": "used in the settings page" + }, + "medium": { + "message": "Medium", + "description": "used in the settings page" + }, + "theme": { + "message": "Тема", + "description": "used in the settings page" + }, + "light": { + "message": "Светлая", + "description": "used in the settings page" + }, + "dark": { + "message": "Тёмная", + "description": "used in the settings page" + }, + "toggleAll": { + "message": "Переключить все", + "description": "used in the settings page" + }, + "notFullyPrivate": { + "message": "Это не полностью приватный фронтенд." + }, + "frontend": { + "message": "Фронтенд", + "description": "used in the settings page" + }, + "searchNote": { + "message": "Примечание: Используйте поиск в полной мере, сделав LibRedirect поисковой системой по умолчанию.", + "description": "used in the settings page" + } +} -- cgit 1.4.1 From 78af3218c65abdd8aa24a24136411de4dd48e199 Mon Sep 17 00:00:00 2001 From: pjammo Date: Thu, 21 Jul 2022 06:52:11 +0000 Subject: Translated using Weblate (Italian) Currently translated at 100.0% (56 of 56 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/it/ --- src/_locales/it/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json index 0d3cb84d..9370f1a9 100644 --- a/src/_locales/it/messages.json +++ b/src/_locales/it/messages.json @@ -211,5 +211,8 @@ "frontend": { "message": "Frontend", "description": "used in the settings page" + }, + "loki": { + "message": "Lokinet" } } -- cgit 1.4.1 From e51d9b9e7eb074ba765c6b24a4ec7847ae41c70e Mon Sep 17 00:00:00 2001 From: Heimen Stoffels Date: Sun, 24 Jul 2022 15:35:48 +0200 Subject: Added translation using Weblate (Dutch) --- src/_locales/nl/messages.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/_locales/nl/messages.json (limited to 'src/_locales') diff --git a/src/_locales/nl/messages.json b/src/_locales/nl/messages.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/src/_locales/nl/messages.json @@ -0,0 +1 @@ +{} -- cgit 1.4.1 From 4206e8d464ef01b987aab013b60ad0ef02ab5d02 Mon Sep 17 00:00:00 2001 From: LeJun Date: Sun, 24 Jul 2022 14:47:02 +0000 Subject: Translated using Weblate (French) Currently translated at 100.0% (54 of 54 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/fr/ --- src/_locales/fr/messages.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/_locales') diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json index 42c3d8dc..c3234890 100644 --- a/src/_locales/fr/messages.json +++ b/src/_locales/fr/messages.json @@ -44,7 +44,7 @@ "description": "used in the settings page" }, "dark": { - "message": "Obscur", + "message": "Sombre", "description": "used in the settings page" }, "autoRedirect": { @@ -56,11 +56,11 @@ "description": "used in the settings page" }, "importSettings": { - "message": "Paramètres d'importation", + "message": "Importation de paramètres", "description": "used in the settings page" }, "exportSettings": { - "message": "Paramètres d'exportation", + "message": "Exportation de paramètres", "description": "used in the settings page" }, "enable": { @@ -214,5 +214,8 @@ }, "loki": { "message": "Lokinet" + }, + "protocolFallback": { + "message": "Retour au mode normal si aucune instance n’est disponible pour le protocole sélectionné" } } -- cgit 1.4.1 From 4b6953826a81b0978ff859fa2f47d75fda735108 Mon Sep 17 00:00:00 2001 From: Oğuz Ersen Date: Sun, 24 Jul 2022 14:29:39 +0000 Subject: Translated using Weblate (Turkish) Currently translated at 100.0% (54 of 54 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/tr/ --- src/_locales/tr/messages.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/_locales') diff --git a/src/_locales/tr/messages.json b/src/_locales/tr/messages.json index 82bf8778..8763af8f 100644 --- a/src/_locales/tr/messages.json +++ b/src/_locales/tr/messages.json @@ -214,5 +214,8 @@ }, "loki": { "message": "Lokinet" + }, + "protocolFallback": { + "message": "Geçerli protokol için hiçbir örnek kullanılabilir değilse normale geri dön" } } -- cgit 1.4.1 From df0d7e5da369a6cc48db80103efbf4fb4f3c775c Mon Sep 17 00:00:00 2001 From: Heimen Stoffels Date: Sun, 24 Jul 2022 14:07:00 +0000 Subject: Translated using Weblate (Dutch) Currently translated at 100.0% (54 of 54 strings) Translation: LibRedirect/extension Translate-URL: https://hosted.weblate.org/projects/libredirect/extension/nl/ --- src/_locales/nl/messages.json | 212 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 211 insertions(+), 1 deletion(-) (limited to 'src/_locales') diff --git a/src/_locales/nl/messages.json b/src/_locales/nl/messages.json index 0967ef42..fa223f60 100644 --- a/src/_locales/nl/messages.json +++ b/src/_locales/nl/messages.json @@ -1 +1,211 @@ -{} +{ + "light": { + "message": "Licht thema", + "description": "used in the settings page" + }, + "system": { + "message": "Systeemthema", + "description": "used in the settings page" + }, + "customInstances": { + "message": "Aangepaste servers", + "description": "used in the settings page" + }, + "dark": { + "message": "Donker thema", + "description": "used in the settings page" + }, + "updateInstances": { + "message": "Serverlijst bijwerken", + "description": "used in the settings page" + }, + "resetSettings": { + "message": "Standaardwaarden", + "description": "used in the settings page" + }, + "customPopup": { + "message": "Pop-upvenster instellen", + "description": "used in the settings page" + }, + "normal": { + "message": "Normaal", + "description": "used in the settings page" + }, + "defaultInstances": { + "message": "Standaardservers", + "description": "used in the settings page" + }, + "toggleAll": { + "message": "Alles aan/uit", + "description": "used in the settings page" + }, + "frontend": { + "message": "Frontend", + "description": "used in the settings page" + }, + "autoRedirect": { + "message": "Automatisch overschakelen naar online-servers", + "description": "used in the settings page" + }, + "importSettings": { + "message": "Instellingen importeren", + "description": "used in the settings page" + }, + "protocol": { + "message": "Protocol", + "description": "used in the settings page" + }, + "extensionName": { + "message": "LibRedirect", + "description": "name of the extension" + }, + "switchInstance": { + "message": "Andere server kiezen", + "description": "used in manifest.json as shortcut description" + }, + "settings": { + "message": "Instellingen", + "description": "used in the popup" + }, + "general": { + "message": "Algemeen", + "description": "used in the settings page" + }, + "search": { + "message": "Zoeken", + "description": "used in the settings page" + }, + "translate": { + "message": "Vertalen", + "description": "used in the settings page" + }, + "maps": { + "message": "Kaarten", + "description": "used in the settings page" + }, + "sendFiles": { + "message": "Bestanden versturen", + "description": "used in the settings page" + }, + "youtube": { + "message": "YouTube", + "description": "used in the settings page" + }, + "instagram": { + "message": "Instagram", + "description": "used in the settings page" + }, + "twitter": { + "message": "Twitter", + "description": "used in the settings page" + }, + "reddit": { + "message": "Reddit", + "description": "used in the settings page" + }, + "tiktok": { + "message": "TikTok", + "description": "used in the settings page" + }, + "ytmusic": { + "message": "YT Music", + "description": "used in the settings page" + }, + "imgur": { + "message": "Imgur", + "description": "used in the settings page" + }, + "wikipedia": { + "message": "Wikipedia", + "description": "used in the settings page" + }, + "peertube": { + "message": "PeerTube", + "description": "used in the settings page" + }, + "medium": { + "message": "Medium", + "description": "used in the settings page" + }, + "theme": { + "message": "Thema", + "description": "used in the settings page" + }, + "extensionDescription": { + "message": "Een browserextensie die je automatisch doorstuurt naar privacy-respecterende alternatieven voor populaire sites", + "description": "description of the extension" + }, + "copied": { + "message": "Gekopieerd" + }, + "lbry": { + "message": "LBRY" + }, + "exceptions": { + "message": "Uitzonderingen", + "description": "used in the settings page" + }, + "notFullyPrivate": { + "message": "Dit frontend is niet volledig privaat." + }, + "searchNote": { + "message": "Tip: benut de extensie optimaal door LibRedirect in te stellen als de standaard zoekmachine.", + "description": "used in the settings page" + }, + "redirectType": { + "message": "Soort doorverwijzing", + "description": "used in the settings page" + }, + "embeddedVids": { + "message": "Ingesloten video's-frontend", + "description": "used in the settings page" + }, + "both": { + "message": "Beide", + "description": "used in the settings page" + }, + "onlyEmbedded": { + "message": "Alleen ingesloten", + "description": "used in the settings page" + }, + "onlyNotEmbedded": { + "message": "Alleen niet-ingesloten", + "description": "used in the settings page" + }, + "instanceOffline": { + "message": "Deze server is offline - je wordt doorgestuurd over ", + "description": "used in instance_offline.html" + }, + "cancel": { + "message": "Annuleren", + "description": "used in instance_offline.html" + }, + "instanceIsOff": { + "message": "Server is offline", + "description": "used in instance_offline.html" + }, + "protocolFallback": { + "message": "Terugvallen op reguliere server als er geen servers met het huidige protocol beschikbaar zijn" + }, + "exportSettings": { + "message": "Instellingen exporteren", + "description": "used in the settings page" + }, + "enable": { + "message": "Inschakelen", + "description": "used in the settings page" + }, + "testInstancesLatency": { + "message": "Controleren op serververtragingen" + }, + "copyRaw": { + "message": "Onbewerkte code kopiëren" + }, + "redirectionCanceled": { + "message": "Doorverwijzen afgebroken", + "description": "used in instance_offline.js" + }, + "unifySettings": { + "message": "Globale instellingen" + } +} -- cgit 1.4.1 From 0803eb5e0484920f31e994303fd2bb07d6f5ec83 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 11:05:49 +0100 Subject: Added lbry desktop Closes https://github.com/libredirect/libredirect/issues/365 --- .prettierrc.json | 1 - src/_locales/en/messages.json | 3 +++ src/assets/javascripts/lbry.js | 37 +++++++++++++++++++++++++++++-------- src/assets/javascripts/wikipedia.js | 2 +- src/pages/options/index.html | 9 ++++++++- src/pages/options/widgets/lbry.js | 32 +++++++++++++++++--------------- src/pages/options/widgets/lbry.pug | 8 +++++++- 7 files changed, 65 insertions(+), 27 deletions(-) (limited to 'src/_locales') diff --git a/.prettierrc.json b/.prettierrc.json index d0df3f36..864a0cc8 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -8,7 +8,6 @@ { "files": ["*.js", "*.json"], "options": { - "tabWidth": 2, "singleQuote": false } }, diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index dfbede1a..23d42e48 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -207,5 +207,8 @@ }, "protocolFallback": { "message": "Fallback to normal if no instances are available for the current protocol" + }, + "lbryDesktop": { + "message": "LBRY Desktop" } } diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index 7f39b734..f0698d36 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -32,6 +32,7 @@ function setRedirects(val) { } let disableLbryTargets, + lbryFrontend, protocol, protocolFallback, lbryTargetsRedirects, @@ -48,6 +49,7 @@ function init() { browser.storage.local.get( [ "disableLbryTargets", + "lbryFrontend", "protocol", "protocolFallback", "lbryTargetsRedirects", @@ -61,6 +63,7 @@ function init() { ], r => { disableLbryTargets = r.disableLbryTargets + lbryFrontend = r.lbryFrontend protocol = r.protocol protocolFallback = r.protocolFallback lbryTargetsRedirects = r.lbryTargetsRedirects @@ -120,17 +123,34 @@ function redirect(url, type, initiator, disableOverride) { if (disableLbryTargets && !disableOverride) return if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) return if (!targets.includes(url.host)) return - if (type != "main_frame") return + if (type != ("main_frame" || "sub_frame")) return + //https://odysee.com/$/embed/the-anti-smartphone-revolution/22b482e450c4ca13c464eee8f51b3a52bbb942ae?r=7pAWcQybShS63wz486r8wVv9FpsDJ47A + // to + //https://{instance}/embed/@Coldfusion:f/the-anti-smartphone-revolution:2 let instancesList = [] - if (protocol == "loki") instancesList = [...librarianLokiCustomRedirects] - else if (protocol == "i2p") instancesList = [...librarianI2pCustomRedirects] - else if (protocol == "tor") instancesList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { - instancesList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects] + switch (lbryFrontend) { + case "librarian": + switch (protocol) { + case "loki": + instancesList = [...librarianLokiCustomRedirects] + break + case "i2p": + instancesList = [...librarianI2pRedirectsChecks, ...librarianI2pCustomRedirects] + break + case "tor": + instancesList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects] + } + if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { + instancesList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects] + } + break + case "lbryDesktop": + if (type == "main_frame") { + return url.href.replace(/^https?:\/{2}odysee\.com\//, "lbry://").replace(/:(?=[a-zA-Z0-9])/g, "#") + } + if (instancesList.length === 0) return } - if (instancesList.length === 0) return - const randomInstance = utils.getRandomInstance(instancesList) return `${randomInstance}${url.pathname}${url.search}` } @@ -147,6 +167,7 @@ function initDefaults() { browser.storage.local.set( { disableLbryTargets: true, + lbryFrontend: "librarian", lbryTargetsRedirects: redirects, librarianNormalRedirectsChecks: [...redirects.librarian.normal], diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index d5c9bfa6..cf19b208 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -2,7 +2,7 @@ window.browser = window.browser || window.chrome import utils from "./utils.js" -const targets = /^https?:\/{2}(([a-z]{1,}\.){0,})wikipedia\.org/ +const targets = /^https?:\/{2}([a-z]+\.)*wikipedia\.org/ const frontends = new Array("wikiless") const protocols = new Array("normal", "tor", "i2p", "loki") diff --git a/src/pages/options/index.html b/src/pages/options/index.html index a1e14d22..84955339 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -2195,13 +2195,20 @@
-

LBRY/Odysee

+

LBRY


Enable

+
+

Frontend

+ +

diff --git a/src/pages/options/widgets/lbry.js b/src/pages/options/widgets/lbry.js index 79be6e18..76e212cb 100644 --- a/src/pages/options/widgets/lbry.js +++ b/src/pages/options/widgets/lbry.js @@ -1,27 +1,23 @@ import utils from "../../../assets/javascripts/utils.js" -// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST - const frontends = new Array("librarian") const protocols = new Array("normal", "tor", "i2p", "loki") const enable = document.getElementById("lbry-enable") const lbry = document.getElementById("lbry_page") -//const frontend = document.getElementById("lbry-frontend"); +const frontend = document.getElementById("lbry-frontend") let protocol -/* function changeFrontendsSettings() { - for (let i = 0; i < frontends.length; i++) { - const frontendDiv = document.getElementById(frontends[i]) - if (frontends[i] == frontend.value) { - frontendDiv.style.display = 'block' - } else { - frontendDiv.style.display = 'none' - } - } + for (let i = 0; i < frontends.length; i++) { + const frontendDiv = document.getElementById(frontends[i]) + if (frontends[i] == frontend.value) { + frontendDiv.style.display = "block" + } else { + frontendDiv.style.display = "none" + } + } } -*/ function changeProtocolSettings() { for (let i = 0; i < frontends.length; i++) { @@ -37,14 +33,20 @@ function changeProtocolSettings() { } } -browser.storage.local.get(["disableLbryTargets", "protocol"], r => { +browser.storage.local.get(["disableLbryTargets", "protocol", "lbryFrontend"], r => { enable.checked = !r.disableLbryTargets protocol = r.protocol + frontend.value = r.lbryFrontend + changeFrontendsSettings() changeProtocolSettings() }) lbry.addEventListener("change", () => { - browser.storage.local.set({ disableLbryTargets: !enable.checked }) + browser.storage.local.set({ + disableLbryTargets: !enable.checked, + lbryFrontend: frontend.value, + }) + changeFrontendsSettings() }) for (let i = 0; i < frontends.length; i++) { diff --git a/src/pages/options/widgets/lbry.pug b/src/pages/options/widgets/lbry.pug index 2bdccb5a..678b87d9 100644 --- a/src/pages/options/widgets/lbry.pug +++ b/src/pages/options/widgets/lbry.pug @@ -1,11 +1,17 @@ section#lbry_page.option-block .some-block.option-block - h1(data-localise="__MSG_lbry__") LBRY/Odysee + h1(data-localise="__MSG_lbry__") LBRY hr .some-block.option-block h4(data-localise="__MSG_enable__") Enable input#lbry-enable(type="checkbox") + .some-block.option-block + h4(data-localise="__MSG_frontend__") Frontend + select#lbry-frontend + option(value="librarian") Librarian + option(value="lbryDesktop" data-localise="__MSG_lbryDesktop__") LBRY Desktop + #librarian hr .normal -- cgit 1.4.1 From 416a4ee13c61dea24adb52a3f3477ec230a38bed Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 14 Aug 2022 14:05:16 +0300 Subject: Fixed typo https://github.com/libredirect/libredirect/issues/408 --- src/_locales/ar/messages.json | 2 +- src/_locales/de/messages.json | 2 +- src/_locales/en/messages.json | 2 +- src/_locales/es/messages.json | 2 +- src/_locales/fr/messages.json | 2 +- src/_locales/gl/messages.json | 2 +- src/_locales/id/messages.json | 2 +- src/_locales/it/messages.json | 2 +- src/_locales/ja/messages.json | 2 +- src/_locales/ko/messages.json | 2 +- src/_locales/nb_NO/messages.json | 2 +- src/_locales/nl/messages.json | 2 +- src/_locales/pl/messages.json | 2 +- src/_locales/pt_BR/messages.json | 2 +- src/_locales/ru/messages.json | 2 +- src/_locales/tr/messages.json | 2 +- src/pages/errors/instance_offline.html | 5 +++-- 17 files changed, 19 insertions(+), 18 deletions(-) (limited to 'src/_locales') diff --git a/src/_locales/ar/messages.json b/src/_locales/ar/messages.json index 4874ef15..86534b00 100644 --- a/src/_locales/ar/messages.json +++ b/src/_locales/ar/messages.json @@ -161,7 +161,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "هذا النظير غير متصل بالإنترنت، سيتم إعادة توجيهك بعد ", + "message": "هذا النظير غير متصل بالإنترنت، سيتم إعادة توجيهك بعد", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json index 55bb0dc4..892918d3 100644 --- a/src/_locales/de/messages.json +++ b/src/_locales/de/messages.json @@ -206,7 +206,7 @@ "message": "I2P" }, "instanceOffline": { - "message": "Diese Instanz ist offline , du wirst weitergeleitet nach  " + "message": "Diese Instanz ist offline , du wirst weitergeleitet nach " }, "testInstancesLatency": { "message": "Teste Latenz der Instanzen" diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 23d42e48..d4217ad9 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -175,7 +175,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "This instance is offline, you'll be redirected after ", + "message": "This instance is offline, you'll be redirected after", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/es/messages.json b/src/_locales/es/messages.json index 07ea98c3..1998e799 100644 --- a/src/_locales/es/messages.json +++ b/src/_locales/es/messages.json @@ -107,7 +107,7 @@ "message": "I2P" }, "instanceOffline": { - "message": "Esta instancia está offline, serás redirigido/a luego de ", + "message": "Esta instancia está offline, serás redirigido/a luego de", "description": "used in instance_offline.html" }, "testInstancesLatency": { diff --git a/src/_locales/fr/messages.json b/src/_locales/fr/messages.json index c3234890..717ec8e1 100644 --- a/src/_locales/fr/messages.json +++ b/src/_locales/fr/messages.json @@ -139,7 +139,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Cette instance est hors ligne, vous serez redirigé après ", + "message": "Cette instance est hors ligne, vous serez redirigé après", "description": "used in instance_offline.html" }, "settings": { diff --git a/src/_locales/gl/messages.json b/src/_locales/gl/messages.json index fba02255..a88810f6 100644 --- a/src/_locales/gl/messages.json +++ b/src/_locales/gl/messages.json @@ -196,7 +196,7 @@ "message": "Esta interface non é totalmente privada." }, "instanceOffline": { - "message": "Esta instancia está caída, ímoste redirixir após ", + "message": "Esta instancia está caída, ímoste redirixir após", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/id/messages.json b/src/_locales/id/messages.json index 5e4d2b16..09ab8fe4 100644 --- a/src/_locales/id/messages.json +++ b/src/_locales/id/messages.json @@ -127,7 +127,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Instansi ini luring, Anda akan dialihkan setelah ", + "message": "Instansi ini luring, Anda akan dialihkan setelah", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/it/messages.json b/src/_locales/it/messages.json index 9370f1a9..eab2d038 100644 --- a/src/_locales/it/messages.json +++ b/src/_locales/it/messages.json @@ -159,7 +159,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Questa istanza è offline, verrai reindirizzato tra ", + "message": "Questa istanza è offline, verrai reindirizzato tra", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/ja/messages.json b/src/_locales/ja/messages.json index 32407e8d..bfae80c9 100644 --- a/src/_locales/ja/messages.json +++ b/src/_locales/ja/messages.json @@ -179,7 +179,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "このインスタンスはオフラインです。 ", + "message": "このインスタンスはオフラインです。", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/ko/messages.json b/src/_locales/ko/messages.json index ad48864c..53cfcc13 100644 --- a/src/_locales/ko/messages.json +++ b/src/_locales/ko/messages.json @@ -115,7 +115,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "이 인스턴스는 오프라인입니다, 다음 초 후에 리다이렉트됩니다: ", + "message": "이 인스턴스는 오프라인입니다, 다음 초 후에 리다이렉트됩니다:", "description": "used in instance_offline.html" }, "notFullyPrivate": { diff --git a/src/_locales/nb_NO/messages.json b/src/_locales/nb_NO/messages.json index 9a18930f..adae7e51 100644 --- a/src/_locales/nb_NO/messages.json +++ b/src/_locales/nb_NO/messages.json @@ -168,7 +168,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Denne instansen er nede. Du vil bli videresendt etter ", + "message": "Denne instansen er nede. Du vil bli videresendt etter", "description": "used in instance_offline.html" }, "copyRaw": { diff --git a/src/_locales/nl/messages.json b/src/_locales/nl/messages.json index fa223f60..e1c1ea17 100644 --- a/src/_locales/nl/messages.json +++ b/src/_locales/nl/messages.json @@ -173,7 +173,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Deze server is offline - je wordt doorgestuurd over ", + "message": "Deze server is offline - je wordt doorgestuurd over", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/pl/messages.json b/src/_locales/pl/messages.json index 8ee06cc0..aed2eda5 100644 --- a/src/_locales/pl/messages.json +++ b/src/_locales/pl/messages.json @@ -100,7 +100,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Ta instancja jest offline, przekierowanie nastąpi po ", + "message": "Ta instancja jest offline, przekierowanie nastąpi po", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/pt_BR/messages.json b/src/_locales/pt_BR/messages.json index 53b1de52..72729117 100644 --- a/src/_locales/pt_BR/messages.json +++ b/src/_locales/pt_BR/messages.json @@ -181,7 +181,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Esta instância está offline, você será redirecionado após ", + "message": "Esta instância está offline, você será redirecionado após", "description": "used in instance_offline.html" }, "instanceIsOff": { diff --git a/src/_locales/ru/messages.json b/src/_locales/ru/messages.json index 04afb07a..f48150fe 100644 --- a/src/_locales/ru/messages.json +++ b/src/_locales/ru/messages.json @@ -96,7 +96,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Этот экземпляр находится в автономном режиме, вы будете перенаправлены после ", + "message": "Этот экземпляр находится в автономном режиме, вы будете перенаправлены после", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/_locales/tr/messages.json b/src/_locales/tr/messages.json index 8763af8f..fe434073 100644 --- a/src/_locales/tr/messages.json +++ b/src/_locales/tr/messages.json @@ -119,7 +119,7 @@ "description": "used in the settings page" }, "instanceOffline": { - "message": "Bu örnek çevrim dışı, yeniden yönlendirileceksiniz ", + "message": "Bu örnek çevrim dışı, yeniden yönlendirileceksiniz", "description": "used in instance_offline.html" }, "cancel": { diff --git a/src/pages/errors/instance_offline.html b/src/pages/errors/instance_offline.html index 4f27445c..a74caec2 100644 --- a/src/pages/errors/instance_offline.html +++ b/src/pages/errors/instance_offline.html @@ -27,8 +27,9 @@
-

- This instance is offline, you'll be redirected after 2 seconds +

+ This instance is offline, you'll be redirected after + 2 seconds

-- cgit 1.4.1 From c1af086c2756f401d8403b259e29f1354c5e001f Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 3 Oct 2022 06:44:49 +0100 Subject: Finished options upgrading --- src/_locales/filter.py | 8 - src/assets/images/sendFiles-icon.svg | 3 + src/assets/images/uploadFiles-icon.svg | 3 - src/assets/javascripts/services.js | 277 +++++++++++++++++---------------- src/assets/javascripts/utils.js | 8 +- src/config/config.json | 5 +- src/instances/get_instances.py | 1 + src/pages/options/index.html | 17 +- src/pages/options/widgets/general.js | 25 ++- src/pages/popup/popup.html | 12 +- src/pages/popup/popup.js | 6 +- 11 files changed, 190 insertions(+), 175 deletions(-) create mode 100644 src/assets/images/sendFiles-icon.svg delete mode 100644 src/assets/images/uploadFiles-icon.svg (limited to 'src/_locales') diff --git a/src/_locales/filter.py b/src/_locales/filter.py index 581bb36c..0d5fb44d 100644 --- a/src/_locales/filter.py +++ b/src/_locales/filter.py @@ -1,12 +1,4 @@ -import requests import json -from urllib.parse import urlparse -from bs4 import BeautifulSoup -import re -from colorama import Fore, Back, Style -from urllib.parse import urlparse -import socket -import subprocess ar_json = {} diff --git a/src/assets/images/sendFiles-icon.svg b/src/assets/images/sendFiles-icon.svg new file mode 100644 index 00000000..5557664e --- /dev/null +++ b/src/assets/images/sendFiles-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/uploadFiles-icon.svg b/src/assets/images/uploadFiles-icon.svg deleted file mode 100644 index 5557664e..00000000 --- a/src/assets/images/uploadFiles-icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 279c8c21..59316dfc 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -406,123 +406,115 @@ function computeService(url, returnFrontend) { } } } - // if (returnFrontend) return [null, null] - // else return null + resolve() }) }) }) } -async function switchInstance(url) { - fetch("/config/config.json") - .then(response => response.text()) - .then(configData => { - const config = JSON.parse(configData) - browser.storage.local.get(["redirects", "options"], r => { - const redirects = r.redirects - const options = r.options - const protocolHost = utils.protocolHost(url) - for (const service in config.services) { - if (!options[service].enabled) continue - if (!all(service, null, options, config, redirects).includes(protocolHost)) continue - - let instancesList = [...options[options[service].frontend][options.network].enabled, ...options[options[service].frontend][options.network].custom] - if (instancesList.length === 0 && options.networkFallback) instancesList = [...options[options[service].frontend].clearnet.enabled, ...options[options[service].frontend].clearnet.custom] - - let oldInstance - const i = instancesList.indexOf(protocolHost) - if (i > -1) { - oldInstance = instancesList[i] - instancesList.splice(i, 1) - } - if (instancesList.length === 0) return - const randomInstance = utils.getRandomInstance(instancesList) - const oldUrl = `${oldInstance}${url.pathname}${url.search}` - // This is to make instance switching work when the instance depends on the pathname, eg https://darmarit.org/searx - // Doesn't work because of .includes array method, not a top priotiry atm - return oldUrl.replace(oldInstance, randomInstance) - } - }) - }) +function switchInstance(url) { + return new Promise(async resolve => { + await init() + const protocolHost = utils.protocolHost(url) + for (const service in config.services) { + if (!all(service, null, options, config, redirects).includes(protocolHost)) continue + + let instancesList = [...options[options[service].frontend][options.network].enabled, ...options[options[service].frontend][options.network].custom] + if (instancesList.length === 0 && options.networkFallback) instancesList = [...options[options[service].frontend].clearnet.enabled, ...options[options[service].frontend].clearnet.custom] + + let oldInstance + const i = instancesList.indexOf(protocolHost) + if (i > -1) { + oldInstance = instancesList[i] + instancesList.splice(i, 1) + } + if (instancesList.length === 0) { + resolve() + return + } + const randomInstance = utils.getRandomInstance(instancesList) + const oldUrl = `${oldInstance}${url.pathname}${url.search}` + // This is to make instance switching work when the instance depends on the pathname, eg https://darmarit.org/searx + // Doesn't work because of .includes array method, not a top priotiry atm + resolve(oldUrl.replace(oldInstance, randomInstance)) + return + } + resolve() + }) } -async function reverse(url) { - fetch("/config/config.json") - .then(response => response.text()) - .then(configData => { - const config = JSON.parse(configData) - browser.storage.local.get(["redirects", "options"], r => { - const redirects = r.redirects - const options = r.options - let protocolHost = utils.protocolHost(url) - for (const service in config.services) { - if (!all(service, null, options, config, redirects).includes(protocolHost)) continue - - switch (service) { - case "instagram": - if (url.pathname.startsWith("/p")) return `https://instagram.com${url.pathname.replace("/p", "")}${url.search}` - if (url.pathname.startsWith("/u")) return `https://instagram.com${url.pathname.replace("/u", "")}${url.search}` - return config.services[service].url + url.pathname + url.search - case "youtube": - case "imdb": - case "imgur": - case "tiktok": - case "twitter": - case "reddit": - return config.services[service].url + url.pathname + url.search - default: - return - } - } - }) - }) +function reverse(url) { + return new Promise(async resolve => { + await init() + let protocolHost = utils.protocolHost(url) + for (const service in config.services) { + if (!all(service, null, options, config, redirects).includes(protocolHost)) continue + + switch (service) { + case "instagram": + if (url.pathname.startsWith("/p")) resolve(`https://instagram.com${url.pathname.replace("/p", "")}${url.search}`) + if (url.pathname.startsWith("/u")) resolve(`https://instagram.com${url.pathname.replace("/u", "")}${url.search}`) + resolve(config.services[service].url + url.pathname + url.search) + return + case "youtube": + case "imdb": + case "imgur": + case "tiktok": + case "twitter": + case "reddit": + resolve(config.services[service].url + url.pathname + url.search) + return + default: + resolve() + return + } + } + resolve() + }) } -async function unifyPreferences(url, tabId) { - fetch("/config/config.json") - .then(response => response.text()) - .then(configData => { - const config = JSON.parse(configData) - browser.storage.local.get(["options", "reidrects"], r => { - const redirects = r.redirects - const options = r.options - const protocolHost = utils.protocolHost(url) - for (const service in config.services) { - for (const frontend in config.services[service].frontends) { - if (all(service, frontend, options, config, redirects).includes(protocolHost)) { - let instancesList = [...options[frontend][options.network].enabled, ...options[frontend][options.network].custom] - if (options.networkFallback && options.network != "clearnet") instancesList.push(...options[frontend].clearnet.enabled, ...options[frontend].clearnet.custom) - - const frontend = config.services[service].frontends[frontend] - if ("cookies" in frontend.preferences) { - for (const cookie of frontend.preferences.cookies) { - utils.copyCookie(frontend, url, instancesList, cookie) - } - } - if ("localstorage" in frontend.preferences) { - browser.storage.local.set({ tmp: [frontend, frontend.preferences.localstorage] }) - browser.tabs.executeScript(tabId, { - file: "/assets/javascripts/get-localstorage.js", +function unifyPreferences(url, tabId) { + return new Promise(async resolve => { + await init() + const protocolHost = utils.protocolHost(url) + for (const service in config.services) { + for (const frontend in config.services[service].frontends) { + if (all(service, frontend, options, config, redirects).includes(protocolHost)) { + let instancesList = [...options[frontend][options.network].enabled, ...options[frontend][options.network].custom] + if (options.networkFallback && options.network != "clearnet") instancesList.push(...options[frontend].clearnet.enabled, ...options[frontend].clearnet.custom) + + const frontendObject = config.services[service].frontends[frontend] + if ("cookies" in frontendObject.preferences) { + for (const cookie of frontendObject.preferences.cookies) { + utils.copyCookie(frontendObject, url, instancesList, cookie) + } + } + if ("localstorage" in frontendObject.preferences) { + browser.storage.local.set({ tmp: [frontend, frontendObject.preferences.localstorage] }) + browser.tabs.executeScript(tabId, { + file: "/assets/javascripts/get-localstorage.js", + runAt: "document_start", + }) + for (const instance of instancesList) + browser.tabs.create({ url: instance }, tab => + browser.tabs.executeScript(tab.id, { + file: "/assets/javascripts/set-localstorage.js", runAt: "document_start", }) - for (const instance of instancesList) - browser.tabs.create({ url: instance }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/set-localstorage.js", - runAt: "document_start", - }) - ) - } - if ("indexeddb" in frontend.preferences) { - } - if ("token" in frontend.preferences) { - } - return true - } + ) + } + /* + if ("indexeddb" in frontendObject.preferences) { } + if ("token" in frontendObject.preferences) { + } + */ + resolve(true) + return } - }) - }) + } + } + }) } async function setRedirects(redirects) { @@ -612,46 +604,67 @@ function upgradeOptions() { fetch("/config/config.json") .then(response => response.text()) .then(configData => { - browser.storage.local.get(["options", "exceptions", "theme", "popupFrontends", "autoRedirect", "firstPartyIsolate"], r => { + browser.storage.local.get(null, r => { let options = r.options let latency = {} const config = JSON.parse(configData) options.exceptions = r.exceptions if (r.theme != "DEFAULT") options.theme = r.theme options.popupServices = r.popupFrontends + let tmp = options.popupServices.indexOf("tikTok") + if (tmp > -1) { + options.popupServices.splice(tmp, 1) + options.popupServices.push("tiktok") + } + tmp = options.popupServices.indexOf("sendTarget") + if (tmp > -1) { + options.popupServices.splice(tmp, 1) + options.popupServices.push("sendFiles") + } options.firstPartyIsolate = r.firstPartyIsolate options.autoRedirect = r.autoRedirect + switch (r.onlyEmbeddedVideo) { + case "onlyNotEmbedded": + options.youtube.redirectType = "main_frame" + case "onlyEmbedded": + options.youtube.redirectType = "sub_frame" + case "both": + options.youtube.redirectType = "both" + } for (const service in config.services) { - browser.storage.local.get([`disable${utils.camelCase(service)}`, `${service}RedirectType`, `${service}Frontend`, `${service}Latency`, `${service}EmbedFrontend`], r => { - if (r) { - options[service].enabled = !r["disable" + utils.camelCase(service)] - if (r[service + "Frontend"]) { - if (r[service + "Frontend"] == "yatte") options[service].frontend = "yattee" - else options[service].frontend = r[service + "Frontend"] - } - if (r[service + "RedirectType"]) options[service].redirectType = r[service + "RedirectType"] - if (r[service + "EmbedFrontend"] && (service != "youtube" || r[service + "EmbedFrontend"] == "invidious" || "piped")) options[service].embedFrontend = r[service + "EmbedFrontend"] - for (const frontend in config.services[service].frontends) { - browser.local.storage.get(`${frontend}Latency`, r => { - if (r) latency[frontend] = r[frontend + "Latency"] - for (const network in config.networks) { - let protocol - if (network == "clearnet") protocol = "normal" - else protocol = network - browser.storage.local.get([`${frontend}${utils.camelCase(protocol)}RedirectsChecks`, `${frontend}${utils.camelCase(protocol)}CustomRedirects`], r => { - if (r) { - options[frontend][network].checks = r[frontend + utils.camelCase(protocol) + "RedirectsChecks"] - options[frontend][network].custom = r[frontend + utils.camelCase(protocol) + "CustomRedirects"] - } - }) - } - }) + let oldService + switch (service) { + case "tiktok": + oldService = "tikTok" + break + case "sendFiles": + oldService = "sendTarget" + break + default: + oldService = service + } + options[service].enabled = !r["disable" + utils.camelCase(oldService)] + if (r[oldService + "Frontend"]) { + if (r[oldService + "Frontend"] == "yatte") options[service].frontend = "yattee" + else options[service].frontend = r[oldService + "Frontend"] + } + if (r[oldService + "RedirectType"]) options[service].redirectType = r[oldService + "RedirectType"] + if (r[oldService + "EmbedFrontend"] && (service != "youtube" || r[oldService + "EmbedFrontend"] == "invidious" || r[oldService + "EmbedFrontend"] == "piped")) + options[service].embedFrontend = r[oldService + "EmbedFrontend"] + for (const frontend in config.services[service].frontends) { + if (r[frontend + "Latency"]) latency[frontend] = r[frontend + "Latency"] + for (const network in config.networks) { + let protocol + if (network == "clearnet") protocol = "normal" + else protocol = network + if (r[frontend + utils.camelCase(protocol) + "RedirectsChecks"]) { + options[frontend][network].enabled = r[frontend + utils.camelCase(protocol) + "RedirectsChecks"] + options[frontend][network].custom = r[frontend + utils.camelCase(protocol) + "CustomRedirects"] } } - }) + } } - browser.storage.local.set({ options, latency }) - resolve() + browser.storage.local.set({ options, latency }, () => resolve()) }) }) }) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 26fe11d6..056bbc00 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -342,7 +342,7 @@ function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { }) } -function copyRaw(test, copyRawElement, config) { +function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { let currTab = tabs[0] @@ -355,7 +355,7 @@ function copyRaw(test, copyRawElement, config) { return } - let newUrl = servicesHelper.reverse(url, config) + const newUrl = await servicesHelper.reverse(url) if (newUrl) { resolve(newUrl) @@ -387,9 +387,7 @@ function unify() { return } - const result = await servicesHelper.unifyPreferences(url, currTab.id) - - resolve(result) + resolve(await servicesHelper.unifyPreferences(url, currTab.id)) } }) }) diff --git a/src/config/config.json b/src/config/config.json index b15c20d4..6866453c 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -22,7 +22,8 @@ "frontends": { "invidious": { "preferences": { - "cookies": ["PREFS"] + "cookies": ["PREFS"], + "localstorage": ["dark_mode"] }, "name": "Invidious", "embeddable": true, @@ -529,7 +530,7 @@ "embeddable": false, "url": "https://maps.libredirect.invalid" }, - "uploadFiles": { + "sendFiles": { "frontends": { "send": { "name": "Send", diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 06b547b3..9a53f927 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -431,6 +431,7 @@ def peertube(): def isValid(url): # This code is contributed by avanitrachhadiya2155 try: + url.encode('ascii') result = urlparse(url) return all([result.scheme, result.netloc]) except Exception: diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 2549566c..5421bb81 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -84,7 +84,7 @@ - Send Files
+ Send Files
@@ -150,11 +150,6 @@
-
- + @@ -3139,14 +3134,14 @@
-
+
-

Send Files

+

Send Files


Enable

- +

diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 1a2f44c6..92632f23 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -49,16 +49,16 @@ function setOption(option, multiChoice, event) { let exportSettingsElement = document.getElementById("export-settings") function exportSettings() { - browser.storage.local.get(null, result => { - let resultString = JSON.stringify(result, null, " ") - exportSettingsElement.href = "data:application/json;base64," + btoa(encodeURI(resultString)) + browser.storage.local.get("options", result => { + result.options.version = browser.runtime.getManifest().version + let resultString = JSON.stringify(result.options, null, " ") + exportSettingsElement.href = "data:application/json;base64," + btoa(resultString) exportSettingsElement.download = "libredirect-settings.json" }) } exportSettings() document.getElementById("general_page").addEventListener("click", exportSettings) -document.getElementById("test").addEventListener("click", servicesHelper.upgradeOptions) let importSettingsElement = document.getElementById("import-settings") let importSettingsElementText = document.getElementById("import_settings_text") @@ -70,7 +70,22 @@ importSettingsElement.addEventListener("change", () => { reader.onload = async () => { const data = JSON.parse(reader.result) if ("theme" in data && "disableImgur" in data && "imgurRedirects" in data) { - browser.storage.local.clear(() => browser.storage.local.set({ ...data }, () => location.reload())) + browser.storage.local.clear(() => + browser.storage.local.set({ ...data }, () => { + fetch("/instances/blacklist.json") + .then(response => response.text()) + .then(async data => { + browser.storage.local.set({ blacklists: JSON.parse(data) }, async () => { + await generalHelper.initDefaults() + await servicesHelper.initDefaults() + await servicesHelper.upgradeOptions() + location.reload() + }) + }) + }) + ) + } else if ("version" in data) { + browser.storage.local.clear(() => browser.storage.local.set({ options: data }, () => location.reload())) } else { console.log("incompatible settings") importError() diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 56e4ca14..b5076635 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -107,13 +107,13 @@

Maps

-
+
-

Send Files

- +

Send Files

+
@@ -220,13 +220,13 @@

Maps

-
+
-

Send Files

- +

Send Files

+
diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index 05dd70f7..ed1546c7 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -26,7 +26,7 @@ utils.switchInstance(true).then(r => { else document.getElementById("change_instance").addEventListener("click", () => utils.switchInstance(false)) }) -utils.copyRaw(true, null, config).then(r => { +utils.copyRaw(true).then(r => { if (!r) document.getElementById("copy_raw_div").style.display = "none" else { const copy_raw = document.getElementById("copy_raw") @@ -81,13 +81,13 @@ browser.storage.local.get("options", r => { let service = await serviceHelper.computeService(url, true) let frontend if (service) { - if (service[1]) { + if (service[0]) { frontend = service[1] service = service[0] } divs[service].current.classList.remove("hide") divs[service].all.classList.add("hide") - if (config.services[service].frontends[frontend].preferences && !config.services[service].frontends[frontend].preferences.token) { + if (frontend && config.services[service].frontends[frontend].preferences && !config.services[service].frontends[frontend].preferences.token) { const unify = document.getElementById("unify") const textElement = document.getElementById("unify").getElementsByTagName("h4")[0] unify.addEventListener("click", () => { -- cgit 1.4.1 From be78f86a67458208279b8cb51b2c6fab4491244c Mon Sep 17 00:00:00 2001 From: Hygna Date: Sat, 8 Oct 2022 11:37:45 +0100 Subject: Added context menu to toggle redirects for a certain tab Closes https://github.com/libredirect/libredirect/issues/464 --- src/_locales/en/messages.json | 4 +++ src/assets/javascripts/services.js | 28 +++++++++------- src/pages/background/background.js | 67 +++++++++++++++++++++++++------------- 3 files changed, 65 insertions(+), 34 deletions(-) (limited to 'src/_locales') diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index d4217ad9..003a878e 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -210,5 +210,9 @@ }, "lbryDesktop": { "message": "LBRY Desktop" + }, + "bypassTab": { + "message": "Toggle redirects in this tab", + "description": "Used in context menus when right clicking on a page/tab" } } diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index a102a297..7e0a76a4 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -68,13 +68,14 @@ function redirect(url, type, initiator) { if (!options[service].enabled) continue if (config.services[service].embeddable && type != options[service].redirectType && options[service].redirectType != "both") continue if (!config.services[service].embeddable && type != "main_frame") continue - let targets = new RegExp(config.services[service].targets.join("|"), "i") + // let targets = new RegExp(config.services[service].targets.join("|"), "i") if (!regexArray(service, url, config)) continue - if (initiator) { - if (targets.test(initiator.host)) continue - if (all(service, null, options, config, redirects).includes(initiator.origin) && reverse(initiator) == url) return "BYPASSTAB" - } + // if (initiator) { + // console.log(initiator.host) + // if (targets.test(initiator.host)) continue + // //if (all(service, null, options, config, redirects).includes(initiator.origin) && reverse(initiator) == url) return "BYPASSTAB" + // } if (Object.keys(config.services[service].frontends).length > 1) { if (type == "sub_frame" && config.services[service].embeddable && !config.services[service].frontends[options[service].frontend].embeddable) frontend = options[service].embedFrontend @@ -473,26 +474,29 @@ function switchInstance(url) { }) } -function reverse(url) { +function reverse(url, urlString) { return new Promise(async resolve => { await init() - let protocolHost = utils.protocolHost(url) + let protocolHost + if (!urlString) protocolHost = utils.protocolHost(url) + else protocolHost = url.match(/https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+/)[0] for (const service in config.services) { if (!all(service, null, options, config, redirects).includes(protocolHost)) continue switch (service) { case "instagram": - if (url.pathname.startsWith("/p")) resolve(`https://instagram.com${url.pathname.replace("/p", "")}${url.search}`) - if (url.pathname.startsWith("/u")) resolve(`https://instagram.com${url.pathname.replace("/u", "")}${url.search}`) - resolve(config.services[service].url + url.pathname + url.search) - return case "youtube": case "imdb": case "imgur": case "tiktok": case "twitter": case "reddit": - resolve(config.services[service].url + url.pathname + url.search) + case "imdb": + case "reuters": + case "quora": + case "medium": + if (!urlString) resolve(config.services[service].url + url.pathname + url.search) + else resolve(url.replace(/https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+/, config.services[service].url)) return default: resolve() diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 3f0e0fdd..f53d7b97 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -69,11 +69,11 @@ browser.webRequest.onBeforeRequest.addListener( console.log(`Canceled ${url}`) return { cancel: true } } - if (newUrl === "BYPASSTAB") { - console.log(`Bypassed ${details.tabId} ${url}`) - if (!BYPASSTABs.includes(details.tabId)) BYPASSTABs.push(details.tabId) - return null - } + // if (newUrl === "BYPASSTAB") { + // console.log(`Bypassed ${details.tabId} ${url}`) + // if (!BYPASSTABs.includes(details.tabId)) BYPASSTABs.push(details.tabId) + // return null + // } console.info("Redirecting", url.href, "=>", newUrl) return { redirectUrl: newUrl } } @@ -91,18 +91,6 @@ browser.tabs.onRemoved.addListener(tabId => { } }) -/* -browser.webRequest.onHeadersReceived.addListener( - e => { - let response = youtubeHelper.removeXFrameOptions(e) - if (!response) response = twitterHelper.removeXFrameOptions(e) - return response - }, - { urls: [""] }, - ["blocking", "responseHeaders"] -) -*/ - async function redirectOfflineInstance(url, tabId) { let newUrl = await servicesHelper.switchInstance(url, true) @@ -170,11 +158,46 @@ browser.contextMenus.create({ contexts: ["browser_action"], }) -browser.contextMenus.onClicked.addListener(info => { - if (info.menuItemId == "switchInstance") utils.switchInstance() - else if (info.menuItemId == "settings") browser.runtime.openOptionsPage() - else if (info.menuItemId == "copyRaw") utils.copyRaw() - else if (info.menuItemId == "unify") utils.unify() +browser.contextMenus.create({ + id: "bypassTab", + title: browser.i18n.getMessage("bypassTab"), + contexts: ["page", "tab"], +}) + +browser.contextMenus.onClicked.addListener((info, tab) => { + return new Promise(async resolve => { + switch (info.menuItemId) { + case "switchInstance": + utils.switchInstance() + resolve() + return + case "settings": + browser.runtime.openOptionsPage() + resolve() + return + case "copyRaw": + utils.copyRaw() + resolve() + return + case "unify": + utils.unify() + resolve() + return + case "bypassTab": + if (!BYPASSTABs.includes(tab.id)) { + BYPASSTABs.push(tab.id) + let newUrl = await servicesHelper.reverse(tab.url, true) + if (newUrl) browser.tabs.update(tab.id, { url: newUrl }) + resolve() + return + } else { + BYPASSTABs.splice(BYPASSTABs.indexOf(tab.id), 1) + browser.tabs.reload(tab.id) + resolve() + return + } + } + }) }) browser.runtime.onMessage.addListener((message, sender, sendResponse) => { -- cgit 1.4.1 From 9560cfc3e793d9fcb4fd8184c3d83fc0f4958f67 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sat, 8 Oct 2022 16:33:39 +0100 Subject: Fixed bugs present in the previous commit --- src/_locales/en/messages.json | 2 +- src/assets/javascripts/services.js | 5 +- src/config/config.json | 61 ++++++++++++++++++------ src/pages/background/background.js | 82 ++++++++++++++++++++++++--------- src/pages/background/reset_warning.html | 59 ------------------------ src/pages/background/reset_warning.js | 7 --- src/pages/stylesheets/styles.css | 5 ++ 7 files changed, 114 insertions(+), 107 deletions(-) delete mode 100644 src/pages/background/reset_warning.html delete mode 100644 src/pages/background/reset_warning.js (limited to 'src/_locales') diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 003a878e..b8dccda3 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -211,7 +211,7 @@ "lbryDesktop": { "message": "LBRY Desktop" }, - "bypassTab": { + "toggleTab": { "message": "Toggle redirects in this tab", "description": "Used in context menus when right clicking on a page/tab" } diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 7e0a76a4..6614bf92 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -60,12 +60,12 @@ function regexArray(service, url, config) { return false } -function redirect(url, type, initiator) { +function redirect(url, type, initiator, forceRedirection) { if (type != "main_frame" && type != "sub_frame") return let randomInstance let frontend for (const service in config.services) { - if (!options[service].enabled) continue + if (!forceRedirection && !options[service].enabled) continue if (config.services[service].embeddable && type != options[service].redirectType && options[service].redirectType != "both") continue if (!config.services[service].embeddable && type != "main_frame") continue // let targets = new RegExp(config.services[service].targets.join("|"), "i") @@ -407,6 +407,7 @@ function redirect(url, type, initiator) { } function computeService(url, returnFrontend) { + console.log(url) return new Promise(resolve => { fetch("/config/config.json") .then(response => response.text()) diff --git a/src/config/config.json b/src/config/config.json index 97168263..642d90ee 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -188,7 +188,9 @@ }, "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com\\/p\\/"], "name": "Instagram", - "options": { "enabled": true }, + "options": { + "enabled": true + }, "imageType": "png", "embeddable": false, "url": "https://instagram.com" @@ -205,7 +207,9 @@ }, "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], "name": "TikTok", - "options": { "enabled": true }, + "options": { + "enabled": true + }, "imageType": "png", "embeddable": false, "url": "https://tiktok.com" @@ -223,6 +227,7 @@ "preferences": { "cookies": [ "collapse_child_comments", + "default_comment_sort", "domain_instagram", "domain_twitter", "domain_youtube", @@ -230,8 +235,11 @@ "highlight_controversial", "nsfw_enabled", "post_media_max_height", + "prefer_frontpage", + "show_large_gallery_images", "show_upvoted_percentage", "show_upvotes", + "subbed_subreddits", "theme", "videos_muted" ] @@ -280,7 +288,9 @@ }, "targets": ["^https?:\\/{2}(?:[a-z]+\\.)*wikipedia\\.org"], "name": "Wikipedia", - "options": { "enabled": false }, + "options": { + "enabled": false + }, "imageType": "svg", "embeddable": false, "url": "https://wikipedia.org" @@ -313,7 +323,9 @@ "^writingcooperative\\.com" ], "name": "Medium", - "options": { "enabled": true }, + "options": { + "enabled": true + }, "imageType": "svgMono", "embeddable": false, "url": "https://medium.com" @@ -330,7 +342,9 @@ }, "targets": ["^https?:\\/{2}([a-z]+\\.)*quora\\.com.*"], "name": "Quora", - "options": { "enabled": true }, + "options": { + "enabled": true + }, "imageType": "png", "embeddable": false, "url": "https://quora.com" @@ -345,9 +359,11 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}(?:www\\.|)imdb\\.com.*"], + "targets": ["^https?:\\/{2}(?:www\\.|)imdb\\.com\\/title"], "name": "IMDb", - "options": { "enabled": false }, + "options": { + "enabled": true + }, "imageType": "svg", "embeddable": false, "url": "https://imdb.com" @@ -361,7 +377,9 @@ }, "targets": ["^https?:\\/{2}(www\\.|)reuters\\.com.*"], "name": "Reuters", - "options": { "enabled": false }, + "options": { + "enabled": false + }, "imageType": "svg", "embeddable": false, "url": "https://reuters.com" @@ -375,7 +393,9 @@ }, "targets": ["^https?:\\/{2}(?:[a-zA-Z0-9]+\\.)?fandom\\.com(?=(?:\\/wiki)|(?:\\/?$))"], "name": "Fandom", - "options": { "enabled": true }, + "options": { + "enabled": true + }, "imageType": "svg", "embeddable": false, "url": "https://fandom.com" @@ -389,7 +409,9 @@ }, "targets": "datajson", "name": "PeerTube", - "options": { "enabled": false }, + "options": { + "enabled": false + }, "imageType": "svg", "embeddable": false, "url": "https://search.joinpeertube.org" @@ -414,7 +436,7 @@ "targets": ["^https?:\\/{2}odysee\\.com", "^https?:\\/{2}lbry\\.tv"], "name": "LBRY", "options": { - "enabled": false, + "enabled": true, "frontend": "librarian", "redirectType": "both", "embedFrontend": "librarian" @@ -455,6 +477,7 @@ "cookies": [ "autocomplete", "categories", + "center_alignment", "disabled_engines", "disabled_plugins", "doi_resolver", @@ -561,15 +584,23 @@ }, "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid", "^https?:\\/{2}send\\.firefox\\.com\\/?$", "^https?:\\/{2}sendfiles\\.online\\/?$"], "name": "Send Files", - "options": { "enabled": true }, + "options": { + "enabled": true + }, "imageType": "svgMono", "embeddable": false, "url": "https://send.libredirect.invalid" } }, "blacklist": { - "cloudflare": { "color": "red" }, - "authenticate": { "color": "orange" }, - "offline": { "color": "grey" } + "cloudflare": { + "color": "red" + }, + "authenticate": { + "color": "orange" + }, + "offline": { + "color": "grey" + } } } diff --git a/src/pages/background/background.js b/src/pages/background/background.js index f53d7b97..54a80011 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -20,6 +20,7 @@ function initDefaults() { } browser.runtime.onInstalled.addListener(details => { + if (details.previousVersion != browser.runtime.getManifest().version) { switch (details.reason) { case "install": initDefaults() @@ -42,9 +43,11 @@ browser.runtime.onInstalled.addListener(details => { }) }) } + } }) -let BYPASSTABs = [] +let tabIdRedirects = {} +// true == Always redirect, false == Never redirect, null/undefined == follow options for services browser.webRequest.onBeforeRequest.addListener( details => { const url = new URL(details.url) @@ -57,23 +60,23 @@ browser.webRequest.onBeforeRequest.addListener( return null } - let newUrl = servicesHelper.redirect(url, details.type, initiator) + if (tabIdRedirects[details.tabId] == false) return null + let newUrl = servicesHelper.redirect(url, details.type, initiator, tabIdRedirects[details.tabId]) if (details.frameAncestors && details.frameAncestors.length > 0 && generalHelper.isException(new URL(details.frameAncestors[0].url))) newUrl = null if (generalHelper.isException(url)) newUrl = "BYPASSTAB" - if (BYPASSTABs.includes(details.tabId)) newUrl = null if (newUrl) { if (newUrl === "CANCEL") { console.log(`Canceled ${url}`) return { cancel: true } } - // if (newUrl === "BYPASSTAB") { - // console.log(`Bypassed ${details.tabId} ${url}`) - // if (!BYPASSTABs.includes(details.tabId)) BYPASSTABs.push(details.tabId) - // return null - // } + if (newUrl === "BYPASSTAB") { + console.log(`Bypassed ${details.tabId} ${url}`) + if (tabIdRedirects[details.tabId] != false) tabIdRedirects[details.tabId] = false + return null + } console.info("Redirecting", url.href, "=>", newUrl) return { redirectUrl: newUrl } } @@ -84,10 +87,9 @@ browser.webRequest.onBeforeRequest.addListener( ) browser.tabs.onRemoved.addListener(tabId => { - const i = BYPASSTABs.indexOf(tabId) - if (i > -1) { - BYPASSTABs.splice(i, 1) - console.log("Removed BYPASSTABs", tabId) + if (tabIdRedirects[tabId] != undefined) { + delete tabIdRedirects[tabId] + console.log("Removed tab " + tabId + " from tabIdRedirects") } }) @@ -159,11 +161,30 @@ browser.contextMenus.create({ }) browser.contextMenus.create({ - id: "bypassTab", - title: browser.i18n.getMessage("bypassTab"), + id: "toggleTab", + title: browser.i18n.getMessage("toggleTab"), contexts: ["page", "tab"], }) +function handleToggleTab(tab) { + return new Promise(async resolve => { + console.log(tabIdRedirects[tab.id]) + switch (tabIdRedirects[tab.id]) { + case false: + console.log("kj") + const newUrl = await servicesHelper.reverse(tab.url, true) + if (newUrl) browser.tabs.update(tab.id, { url: newUrl }) + resolve() + return + case true: + console.log("lsad") + browser.tabs.reload(tab.id) + resolve() + return + } + }) +} + browser.contextMenus.onClicked.addListener((info, tab) => { return new Promise(async resolve => { switch (info.menuItemId) { @@ -183,18 +204,33 @@ browser.contextMenus.onClicked.addListener((info, tab) => { utils.unify() resolve() return - case "bypassTab": - if (!BYPASSTABs.includes(tab.id)) { - BYPASSTABs.push(tab.id) - let newUrl = await servicesHelper.reverse(tab.url, true) - if (newUrl) browser.tabs.update(tab.id, { url: newUrl }) + case "toggleTab": + if (tabIdRedirects[tab.id] != undefined) { + tabIdRedirects[tab.id] = !tabIdRedirects[tab.id] + await handleToggleTab(tab) resolve() return } else { - BYPASSTABs.splice(BYPASSTABs.indexOf(tab.id), 1) - browser.tabs.reload(tab.id) - resolve() - return + console.log("n") + const url = new URL(tab.url) + const service = await servicesHelper.computeService(url) + console.log(service) + if (service) { + console.log("h") + browser.storage.local.get("options", async r => { + console.log(r.options[service]) + if (r.options[service].enabled) tabIdRedirects[tab.id] = false + else tabIdRedirects[tab.id] = true + await handleToggleTab(tab) + resolve() + return + }) + } else { + tabIdRedirects[tab.id] = false + await handleToggleTab(tab) + resolve() + return + } } } }) diff --git a/src/pages/background/reset_warning.html b/src/pages/background/reset_warning.html deleted file mode 100644 index f1881ed8..00000000 --- a/src/pages/background/reset_warning.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - Reset Warning - - - - - -
- - -

All settings have been reset as they're incompatible with the previous version.

-

Sorry for the inconvenience, but we're going in a fast development process and can't support nor convert older settings. It will reach a stable plateau though.

- - - - - -   - Export Settings - -
- - - diff --git a/src/pages/background/reset_warning.js b/src/pages/background/reset_warning.js deleted file mode 100644 index 9ce49c9a..00000000 --- a/src/pages/background/reset_warning.js +++ /dev/null @@ -1,7 +0,0 @@ -let params = new URLSearchParams(location.search) - -const resultString = JSON.stringify(JSON.parse(params.get("data")), null, " ") - -let exportSettingsElement = document.getElementById("export-settings") -exportSettingsElement.href = "data:application/json;base64," + btoa(resultString) -exportSettingsElement.download = "libredirect-settings.json" diff --git a/src/pages/stylesheets/styles.css b/src/pages/stylesheets/styles.css index eb599656..072b5d5b 100644 --- a/src/pages/stylesheets/styles.css +++ b/src/pages/stylesheets/styles.css @@ -477,3 +477,8 @@ input:disabled { opacity: 0.6; cursor: not-allowed; } + +div.about a { + width: 500px; + display: inline-block; +} -- cgit 1.4.1 From 6fdf65663053d2e9c951f6153f108be8d3744204 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sat, 8 Oct 2022 17:48:24 +0100 Subject: Added context menu to redirect Closes https://github.com/libredirect/libredirect/issues/414 --- src/_locales/en/messages.json | 4 +++ src/assets/javascripts/services.js | 1 - src/config/config.json | 2 +- src/pages/background/background.js | 62 +++++++++++++++++++++----------------- 4 files changed, 39 insertions(+), 30 deletions(-) (limited to 'src/_locales') diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index b8dccda3..3887856c 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -214,5 +214,9 @@ "toggleTab": { "message": "Toggle redirects in this tab", "description": "Used in context menus when right clicking on a page/tab" + }, + "redirectLink": { + "message": "Attempt to redirect this hyperlink", + "description": "Used in context menus when right clicking on a hyperlink" } } diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 6614bf92..80a1ac45 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -407,7 +407,6 @@ function redirect(url, type, initiator, forceRedirection) { } function computeService(url, returnFrontend) { - console.log(url) return new Promise(resolve => { fetch("/config/config.json") .then(response => response.text()) diff --git a/src/config/config.json b/src/config/config.json index 642d90ee..ff4a869f 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -414,7 +414,7 @@ }, "imageType": "svg", "embeddable": false, - "url": "https://search.joinpeertube.org" + "url": "https://joinpeertube.org" }, "lbry": { "frontends": { diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 54a80011..d252e580 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -21,28 +21,28 @@ function initDefaults() { browser.runtime.onInstalled.addListener(details => { if (details.previousVersion != browser.runtime.getManifest().version) { - switch (details.reason) { - case "install": - initDefaults() - break - case "update": - fetch("/instances/blacklist.json") - .then(response => response.text()) - .then(async data => { - browser.storage.local.set({ blacklists: JSON.parse(data) }, async () => { - switch (details.previousVersion) { - case "2.2.0": - case "2.2.1": - await generalHelper.initDefaults() - await servicesHelper.initDefaults() - await servicesHelper.upgradeOptions() - break - default: - await servicesHelper.processUpdate() - } + switch (details.reason) { + case "install": + initDefaults() + break + case "update": + fetch("/instances/blacklist.json") + .then(response => response.text()) + .then(async data => { + browser.storage.local.set({ blacklists: JSON.parse(data) }, async () => { + switch (details.previousVersion) { + case "2.2.0": + case "2.2.1": + await generalHelper.initDefaults() + await servicesHelper.initDefaults() + await servicesHelper.upgradeOptions() + break + default: + await servicesHelper.processUpdate() + } + }) }) - }) - } + } } }) @@ -166,18 +166,21 @@ browser.contextMenus.create({ contexts: ["page", "tab"], }) +browser.contextMenus.create({ + id: "redirectLink", + title: browser.i18n.getMessage("redirectLink"), + contexts: ["link"], +}) + function handleToggleTab(tab) { return new Promise(async resolve => { - console.log(tabIdRedirects[tab.id]) switch (tabIdRedirects[tab.id]) { case false: - console.log("kj") const newUrl = await servicesHelper.reverse(tab.url, true) if (newUrl) browser.tabs.update(tab.id, { url: newUrl }) resolve() return case true: - console.log("lsad") browser.tabs.reload(tab.id) resolve() return @@ -211,14 +214,10 @@ browser.contextMenus.onClicked.addListener((info, tab) => { resolve() return } else { - console.log("n") const url = new URL(tab.url) const service = await servicesHelper.computeService(url) - console.log(service) if (service) { - console.log("h") browser.storage.local.get("options", async r => { - console.log(r.options[service]) if (r.options[service].enabled) tabIdRedirects[tab.id] = false else tabIdRedirects[tab.id] = true await handleToggleTab(tab) @@ -232,6 +231,13 @@ browser.contextMenus.onClicked.addListener((info, tab) => { return } } + case "redirectLink": + console.log(info.linkUrl) + const tmpUrl = new URL(info.linkUrl) + const newUrl = servicesHelper.redirect(tmpUrl, "main_frame", null, true) + if (newUrl) browser.tabs.create({ url: newUrl }) + resolve() + return } }) }) -- cgit 1.4.1