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 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(-) 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(-) 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(+) 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 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(-) 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 b1bc637975e1967834860e5ff5417e595ec30fe5 Mon Sep 17 00:00:00 2001 From: EdwardLangdon <101938856+EdwardLangdon@users.noreply.github.com> Date: Wed, 13 Jul 2022 13:52:41 +0000 Subject: Added Piped Instance - projectsegfau.lt --- src/instances/piped.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/instances/piped.json b/src/instances/piped.json index 49619bd3..14b7e661 100644 --- a/src/instances/piped.json +++ b/src/instances/piped.json @@ -11,7 +11,8 @@ "https://yt.jae.fi", "https://piped.mint.lgbt", "https://piped.privacy.com.de", - "https://piped.esmailelbob.xyz" + "https://piped.esmailelbob.xyz", + "https://piped.projectsegfau.lt/" ], "tor": [ "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" -- cgit 1.4.1 From 9efbaccc14b5af7a74bd6eeac009720d7bfba06b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 13 Jul 2022 22:32:45 +0000 Subject: update instances --- src/instances/blacklist.json | 11 +++----- src/instances/data.json | 65 ++++++++++++++++++++------------------------ 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 025f5935..c7534253 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -16,6 +16,7 @@ "https://nitter.winscloud.net", "https://twtr.bch.bar", "https://twitter.dr460nf1r3.org", + "https://nitter.garudalinux.org", "https://nitter.wef.lol", "https://nitter.catalyst.sx", "https://bib.actionsack.com", @@ -24,7 +25,6 @@ "https://libreddit.flux.industries", "https://lr.oversold.host", "https://libreddit.hu", - "https://lr.stilic.ml", "https://reddi.tk", "https://r.walkx.org", "https://libreddit.yonalee.eu", @@ -37,20 +37,17 @@ "https://teddit.httpjames.space", "https://teddit.encrypted-data.xyz", "https://wiki.604kph.xyz", - "https://wikiless.lunar.icu", - "https://lingva.lunar.icu", - "https://searx.josie.lol", "https://searx.org", "https://searx.run", - "https://searx.albony.xyz", "https://searx.kujonello.cf", "https://search.albony.xyz", "https://search.garudalinux.org", "https://search.dr460nf1r3.org", "https://search.wef.lol", - "https://i.actionsack.com" + "https://i.actionsack.com", + "https://rimgo.encrypted-data.xyz" ], "authenticate": [ "https://nitter.nixnet.services" ] -} +} \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index 1c942300..0b8e1215 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -4,9 +4,7 @@ "https://yewtu.be", "https://vid.puffyan.us", "https://invidious.snopyta.org", - "https://invidious.kavin.rocks", "https://inv.riverside.rocks", - "https://invidious.osi.kr", "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.flokinet.to", @@ -18,14 +16,17 @@ "https://invidious.nerdvpn.de", "https://invidious.slipfox.xyz", "https://youtube.076.ne.jp", - "https://invidious.esmailelbob.xyz", "https://invidious.weblibre.org", - "https://invidious.namazso.eu" + "https://invidious.esmailelbob.xyz", + "https://invidious.namazso.eu", + "https://invidious.kavin.rocks", + "https://invidious.osi.kr" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", + "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", "http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion/", @@ -46,7 +47,8 @@ "https://yt.jae.fi", "https://piped.mint.lgbt", "https://piped.privacy.com.de", - "https://piped.esmailelbob.xyz" + "https://piped.esmailelbob.xyz", + "https://piped.projectsegfau.lt/" ], "tor": [ "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" @@ -128,6 +130,7 @@ "https://nitter.bird.froth.zone", "https://nitter.dcs0.hu", "https://twitter.dr460nf1r3.org", + "https://nitter.garudalinux.org", "https://twitter.beparanoid.de", "https://n.ramle.be", "https://nitter.cz", @@ -143,7 +146,8 @@ "https://nitter.wef.lol", "https://nitter.tokhmi.xyz", "https://nitter.catalyst.sx", - "https://unofficialbird.com" + "https://unofficialbird.com", + "https://nitter.projectsegfau.lt" ], "tor": [ "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", @@ -181,9 +185,10 @@ "https://bibliogram.froth.zone", "https://insta.trom.tf", "https://insta.tromdienste.de", - "https://biblio.alefvanoon.xyz", + "https://ig.tokhmi.xyz", "https://ig.beparanoid.de", "https://bibliogram.privacydev.net", + "https://bibliogram.priv.pw", "https://bib.actionsack.com" ], "tor": [] @@ -344,7 +349,8 @@ "https://quetre.pussthecat.org", "https://wuetre.herokuapp.com", "https://quetreus.herokuapp.com", - "https://quetre.tokhmi.xyz" + "https://quetre.tokhmi.xyz", + "https://quetre.projectsegfau.lt" ], "tor": [] }, @@ -402,13 +408,11 @@ "searx": { "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", - "http://searx.bsbvtqi5oq2cqzn32zt4cr2f2z2rwots3dq7gmdcnlyqoxko2wx6reqd.onion" + "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion" ], "i2p": [ "http://ransack.i2p", @@ -418,9 +422,7 @@ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", - "https://nibblehole.com", "https://search.ethibox.fr", - "https://search.jpope.org", "https://search.snopyta.org", "https://search.stinpriza.org", "https://search.trom.tf", @@ -429,7 +431,6 @@ "https://searx.dresden.network", "https://searx.fossencdi.org", "https://searx.gnu.style", - "https://searx.josie.lol", "https://searx.mastodontech.de", "https://searx.mxchange.org", "https://searx.nakhan.net", @@ -437,7 +438,6 @@ "https://searx.nixnet.services", "https://searx.openhoofd.nl", "https://searx.org", - "https://searx.ppeb.me", "https://searx.pwoss.org", "https://searx.rasp.fr", "https://searx.ru", @@ -457,12 +457,12 @@ "https://suche.uferwerk.org", "https://sx.catgirl.cloud", "https://timdor.noip.me/searx", - "https://www.gruble.de", "https://searx.roflcopter.fr" ] }, "searxng": { "tor": [ + "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", @@ -478,16 +478,21 @@ "https://darmarit.org/searx", "https://de.xcxc.ml", "https://etsi.me", + "https://icanfindit.online", "https://northboot.xyz", "https://notgoogle.win", "https://opnxng.com", "https://paulgo.io", + "https://private-searx.ml", + "https://privatus.live", "https://s.frlt.one", "https://s.zhaocloud.net", "https://search.ashs.club", "https://search.bingowaves.xyz", "https://search.bus-hit.me", + "https://search.chemicals-in-the-water.eu", "https://search.disroot.org", + "https://search.gcomm.ch", "https://search.kiwitalk.de", "https://search.mdosch.de", "https://search.neet.works", @@ -499,7 +504,6 @@ "https://search.unlocked.link", "https://search.vojkovic.xyz", "https://search.zzls.xyz", - "https://searx.albony.xyz", "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", @@ -532,6 +536,7 @@ "https://serx.ml", "https://srx.cosmohub.io", "https://swag.pw", + "https://www.gruble.de", "https://www.webrats.xyz", "https://xcxc.ml" ] @@ -565,21 +570,24 @@ "https://i.actionsack.com", "https://rimgo.privacydev.net", "https://imgur.artemislena.eu", - "https://rimgo.vern.cc" + "https://rimgo.vern.cc", + "https://rimgo.encrypted-data.xyz", + "https://rimgo.mha.fi" ], "tor": [ "http://rimgo.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://rimgo.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], "i2p": [] }, "peertube": [ + "https://peertube.ctrl-c.liu.se", + "https://peertube.live", "https://video.slipfox.xyz", "https://pt.vern.cc", - "https://3.600900.su", "https://vnop.org", "https://videos.cassidypunchmachine.com", - "https://video.mullet.social", "https://tv1.gomntu.space", "https://dalek.zone", "https://seka.pona.la", @@ -638,10 +646,8 @@ "https://tube.nestor.coop", "https://live.oldskool.fi", "https://dytube.com", - "https://video.toby3d.me", "https://tube.thierrytalbert.fr", "https://peertube.informaction.info", - "https://peertube.thele.me", "https://tube.ac-amiens.fr", "https://tube.alado.space", "https://tube.network.europa.eu", @@ -653,7 +659,6 @@ "https://cliptube.org", "https://tube.tr4sk.me", "https://videos.campdarling.com", - "https://peertube.live", "https://video.mikka.md", "https://www.aktion-nordost.tv", "https://tube.rooty.fr", @@ -752,7 +757,6 @@ "https://peertube.hacknews.pmdcollab.org", "https://freetubes.nohost.me", "https://video.simplex-software.ru", - "https://wwtube.net", "https://video.snug.moe", "https://video.avant-le-strike.buzz", "https://videos.ritimo.org", @@ -760,7 +764,6 @@ "https://video.cerclearistote.com", "https://computerstuff.mooo.com", "https://video.greenmycity.eu", - "https://peertubemirror.satoshishop.de", "https://przej.me", "https://pt.mezzo.moe", "https://tube.dsocialize.net", @@ -859,7 +862,6 @@ "https://tube.1o1.io", "https://peertube.aventer.biz", "https://videos.rights.ninja", - "https://pertur.be", "https://tube.pilgerweg-21.de", "https://freediverse.com", "https://pocketnetpeertube2.nohost.me", @@ -900,7 +902,6 @@ "https://dud-video.inf.tu-dresden.de", "https://media-test.interior.edu.uy", "https://media.interior.edu.uy", - "https://bitcast.online", "https://peertube.la-scic.fr", "https://phoenixproject.group", "https://peertube.sebu77.com", @@ -1118,7 +1119,6 @@ "https://video.shitposter.club", "https://tv.mattchristiansenmedia.com", "https://tube.hackerscop.org", - "https://videos.capas.se", "https://peertube.kx.studio", "https://videos.3d-wolf.com", "https://tube.octaplex.net", @@ -1218,7 +1218,6 @@ "https://evangelisch.video", "https://tube.anufrij.de", "https://videos.mastodont.cat", - "https://flim.txmn.tk", "https://video.taboulisme.com", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", @@ -1354,7 +1353,6 @@ "https://tube.others.social", "https://videos.ubuntu-paris.org", "https://tube-poitiers.beta.education.fr", - "https://streamsource.video", "https://vid.wildeboer.net", "https://battlepenguin.video", "https://peertube.cloud.sans.pub", @@ -1380,7 +1378,6 @@ "https://peertube.devloprog.org", "https://peertube.designersethiques.org", "https://testtube.florimond.eu", - "https://tube.gnous.eu", "https://tube-lille.beta.education.fr", "https://peertube.monlycee.net", "https://tube.plomlompom.com", @@ -1510,7 +1507,6 @@ "https://video.lemediatv.fr", "https://peertube.artica.center", "https://indymotion.fr", - "https://video.farci.org", "https://tube.fede.re", "https://peertube.mygaia.org", "https://peertube.livingutopia.org", @@ -1550,7 +1546,6 @@ "https://www.yiny.org", "https://video.typica.us", "https://videos.lescommuns.org", - "https://dialup.express", "https://peertube.1312.media", "https://skeptikon.fr", "https://video.blueline.mg", @@ -1578,4 +1573,4 @@ "https://peertube2.cpy.re", "https://peertube.cpy.re" ] -} +} \ No newline at end of file -- cgit 1.4.1 From 6b03956e33ee5191f646a99b3846c848d4bcc10e Mon Sep 17 00:00:00 2001 From: EdwardLangdon <101938856+EdwardLangdon@users.noreply.github.com> Date: Sat, 16 Jul 2022 01:32:52 +0000 Subject: Add Piped Instance & fix trailing slash --- src/instances/piped.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/instances/piped.json b/src/instances/piped.json index 49619bd3..ce0a4eb7 100644 --- a/src/instances/piped.json +++ b/src/instances/piped.json @@ -7,7 +7,8 @@ "https://piped.syncpundit.com", "https://piped.mha.fi", "https://piped.shimul.me", - "https://pipedus.palash.dev/", + "https://pipedus.palash.dev", + "https://piped.waffle.wiki", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://piped.privacy.com.de", -- cgit 1.4.1 From bd761e7bdd4dae9538e691410d94a38ba70f8d55 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 16 Jul 2022 22:32:42 +0000 Subject: update instances --- src/instances/blacklist.json | 2 +- src/instances/data.json | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index c7534253..710ebc14 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -18,13 +18,13 @@ "https://twitter.dr460nf1r3.org", "https://nitter.garudalinux.org", "https://nitter.wef.lol", - "https://nitter.catalyst.sx", "https://bib.actionsack.com", "https://libreddit.domain.glass", "https://r.nf", "https://libreddit.flux.industries", "https://lr.oversold.host", "https://libreddit.hu", + "https://lr.stilic.ml", "https://reddi.tk", "https://r.walkx.org", "https://libreddit.yonalee.eu", diff --git a/src/instances/data.json b/src/instances/data.json index 0b8e1215..bf2f0196 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -5,6 +5,7 @@ "https://vid.puffyan.us", "https://invidious.snopyta.org", "https://inv.riverside.rocks", + "https://invidious.osi.kr", "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.flokinet.to", @@ -19,8 +20,7 @@ "https://invidious.weblibre.org", "https://invidious.esmailelbob.xyz", "https://invidious.namazso.eu", - "https://invidious.kavin.rocks", - "https://invidious.osi.kr" + "https://invidious.kavin.rocks" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -147,7 +147,9 @@ "https://nitter.tokhmi.xyz", "https://nitter.catalyst.sx", "https://unofficialbird.com", - "https://nitter.projectsegfau.lt" + "https://nitter.projectsegfau.lt", + "https://singapore.unofficialbird.com", + "https://twt.funami.tech" ], "tor": [ "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", @@ -411,8 +413,7 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" ], "i2p": [ "http://ransack.i2p", @@ -422,6 +423,7 @@ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", + "https://notgoogle.win", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -436,7 +438,6 @@ "https://searx.nakhan.net", "https://searx.netzspielplatz.de", "https://searx.nixnet.services", - "https://searx.openhoofd.nl", "https://searx.org", "https://searx.pwoss.org", "https://searx.rasp.fr", @@ -451,6 +452,7 @@ "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", + "https://searxng.ir", "https://spot.ecloud.global", "https://suche.dasnetzundich.de", "https://suche.tromdienste.de", @@ -470,6 +472,7 @@ "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", + "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" ], @@ -480,7 +483,6 @@ "https://etsi.me", "https://icanfindit.online", "https://northboot.xyz", - "https://notgoogle.win", "https://opnxng.com", "https://paulgo.io", "https://private-searx.ml", @@ -498,6 +500,7 @@ "https://search.neet.works", "https://search.ononoki.org", "https://search.privacyguides.net", + "https://search.projectsegfau.lt", "https://search.rabbit-company.com", "https://search.sapti.me", "https://search.teamriverbubbles.com", @@ -530,7 +533,6 @@ "https://searx.youshitsune.me", "https://searx.zcyph.cc", "https://searxng.au/searx", - "https://searxng.ir", "https://searxng.tordenskjold.de", "https://searxng.zackptg5.com", "https://serx.ml", @@ -582,6 +584,7 @@ "i2p": [] }, "peertube": [ + "https://video.fox-romka.ru", "https://peertube.ctrl-c.liu.se", "https://peertube.live", "https://video.slipfox.xyz", @@ -696,7 +699,6 @@ "https://videos.redeyes.site", "https://video.hostpath.de", "https://free-streams.com", - "https://video.chadwaltercummings.me", "https://tube.pawelko.net", "https://video.livecchi.cloud", "https://anarchy.video", @@ -783,7 +785,6 @@ "https://creemoseducacioninclusiva.uma.es", "https://videos.yeswiki.net", "https://tube.lrk.sh", - "https://peertube.teneriffe.nohost.me", "https://peertube.autogestioncitoyenne.org", "https://stream.dynacloud.ynh.fr", "https://video.r3s.nrw", @@ -796,7 +797,6 @@ "https://vid.lelux.fi", "https://v.wolfskaempf.de", "https://peertube.chevro.fr", - "https://peertube.minecloud.ro", "https://media.econoalchemist.com", "https://video.qoto.org", "https://peertube.maxweiss.io", @@ -1022,7 +1022,6 @@ "https://video.ustim.ru", "https://merci-la-police.fr", "https://pocketnetpeertube7.nohost.me", - "https://tube.noise.rocks", "https://video.rhizome.org", "https://dnk.video", "https://video.medienzentrum-harburg.de", @@ -1294,7 +1293,6 @@ "https://www4.mir.inter21.net", "https://video.csc49.fr", "https://tube.wolfe.casa", - "https://tube.linkse.media", "https://video.dresden.network", "https://peertube.zapashcanon.fr", "https://40two.tube", @@ -1333,7 +1331,6 @@ "https://xxx.noho.st", "https://peertube.stefofficiel.me", "https://canard.tube", - "https://videos.jordanwarne.xyz", "https://tube.jeena.net", "https://tube.cloud-libre.eu", "https://videos.coletivos.org", @@ -1513,7 +1510,6 @@ "https://tube.anjara.eu", "https://video.latavernedejohnjohn.fr", "https://peertube.pcservice46.fr", - "https://alttube.fr", "https://video.coop.tools", "https://video.cabane-libre.org", "https://peertube.openstreetmap.fr", -- cgit 1.4.1 From 637dc462d95112cdfb949e55a892841b53a89528 Mon Sep 17 00:00:00 2001 From: EdwardLangdon <101938856+EdwardLangdon@users.noreply.github.com> Date: Sun, 17 Jul 2022 03:23:04 +0000 Subject: Add Instance - Whatever.social --- src/instances/piped.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/instances/piped.json b/src/instances/piped.json index ce0a4eb7..08b7d2f6 100644 --- a/src/instances/piped.json +++ b/src/instances/piped.json @@ -9,6 +9,7 @@ "https://piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", + "https://watch.whatever.social", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://piped.privacy.com.de", -- 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(+) 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(+) 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(+) 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(+) 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 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 a02cd3cceedd7eed62062aa0932cbf57ac2adb25 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 19 Jul 2022 22:33:10 +0000 Subject: update instances --- src/instances/blacklist.json | 6 ++++-- src/instances/data.json | 34 +++++++++++++++------------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 710ebc14..726e4fe3 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -7,7 +7,9 @@ "https://piped.syncpundit.com", "https://piped.mha.fi", "https://piped.shimul.me", - "https://pipedus.palash.dev/", + "https://pipedus.palash.dev", + "https://piped.waffle.wiki", + "https://watch.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", "https://nitter.moomoo.me", @@ -18,6 +20,7 @@ "https://twitter.dr460nf1r3.org", "https://nitter.garudalinux.org", "https://nitter.wef.lol", + "https://nitter.fprivacy.com", "https://bib.actionsack.com", "https://libreddit.domain.glass", "https://r.nf", @@ -39,7 +42,6 @@ "https://wiki.604kph.xyz", "https://searx.org", "https://searx.run", - "https://searx.kujonello.cf", "https://search.albony.xyz", "https://search.garudalinux.org", "https://search.dr460nf1r3.org", diff --git a/src/instances/data.json b/src/instances/data.json index bf2f0196..27745298 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -4,6 +4,7 @@ "https://yewtu.be", "https://vid.puffyan.us", "https://invidious.snopyta.org", + "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", "https://y.com.sb", @@ -17,10 +18,9 @@ "https://invidious.nerdvpn.de", "https://invidious.slipfox.xyz", "https://youtube.076.ne.jp", - "https://invidious.weblibre.org", "https://invidious.esmailelbob.xyz", - "https://invidious.namazso.eu", - "https://invidious.kavin.rocks" + "https://invidious.weblibre.org", + "https://invidious.namazso.eu" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -43,7 +43,9 @@ "https://piped.syncpundit.com", "https://piped.mha.fi", "https://piped.shimul.me", - "https://pipedus.palash.dev/", + "https://pipedus.palash.dev", + "https://piped.waffle.wiki", + "https://watch.whatever.social", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://piped.privacy.com.de", @@ -141,7 +143,6 @@ "https://nitter.oishi-ra.men", "https://nitter.foss.wtf", "https://nitter.priv.pw", - "https://t.com.sb", "https://nt.vern.cc", "https://nitter.wef.lol", "https://nitter.tokhmi.xyz", @@ -149,7 +150,8 @@ "https://unofficialbird.com", "https://nitter.projectsegfau.lt", "https://singapore.unofficialbird.com", - "https://twt.funami.tech" + "https://twt.funami.tech", + "https://nitter.fprivacy.com" ], "tor": [ "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", @@ -191,6 +193,7 @@ "https://ig.beparanoid.de", "https://bibliogram.privacydev.net", "https://bibliogram.priv.pw", + "https://ig.funami.tech", "https://bib.actionsack.com" ], "tor": [] @@ -423,7 +426,6 @@ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", - "https://notgoogle.win", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -449,10 +451,10 @@ "https://searx.tuxcloud.net", "https://searx.tyil.nl", "https://searx.vanwa.tech", + "https://searx.vimproved.me", "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", - "https://searxng.ir", "https://spot.ecloud.global", "https://suche.dasnetzundich.de", "https://suche.tromdienste.de", @@ -466,6 +468,7 @@ "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://x5gdjh6t7kb4yubpufhtc3l3df2acev3emxdasd5vyuyoon5rzf5zkyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", @@ -482,9 +485,11 @@ "https://de.xcxc.ml", "https://etsi.me", "https://icanfindit.online", + "https://jackgoss.xyz", "https://northboot.xyz", "https://opnxng.com", "https://paulgo.io", + "https://priv.au", "https://private-searx.ml", "https://privatus.live", "https://s.frlt.one", @@ -505,7 +510,6 @@ "https://search.sapti.me", "https://search.teamriverbubbles.com", "https://search.unlocked.link", - "https://search.vojkovic.xyz", "https://search.zzls.xyz", "https://searx.be", "https://searx.becomesovran.com", @@ -516,7 +520,6 @@ "https://searx.fi", "https://searx.fmac.xyz", "https://searx.gnous.eu", - "https://searx.kujonello.cf", "https://searx.loafland.xyz", "https://searx.mha.fi", "https://searx.mistli.net", @@ -529,10 +532,10 @@ "https://searx.slipfox.xyz/searx", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "https://searx.tiekoetter.com", - "https://searx.vimproved.me", "https://searx.youshitsune.me", "https://searx.zcyph.cc", "https://searxng.au/searx", + "https://searxng.ir", "https://searxng.tordenskjold.de", "https://searxng.zackptg5.com", "https://serx.ml", @@ -584,6 +587,7 @@ "i2p": [] }, "peertube": [ + "https://hitchtube.fr", "https://video.fox-romka.ru", "https://peertube.ctrl-c.liu.se", "https://peertube.live", @@ -599,7 +603,6 @@ "https://tube.miegl.cz", "https://mov.clov.fr", "https://videomensoif.ynh.fr", - "https://peertube.hainry.fr", "https://videos.neongarden.life", "https://video.vaku.org.ua", "https://videos.trom.lt", @@ -691,10 +694,8 @@ "https://videopen.net", "https://demo.lioncast.org", "https://peertube.get-racing.de", - "https://tube-rennes.beta.education.fr", "https://pierre.tube", "https://mirametube.fr", - "https://tube.sanyi.nl", "https://vidz.dou.bet", "https://videos.redeyes.site", "https://video.hostpath.de", @@ -723,7 +724,6 @@ "https://tube.linc.systems", "https://peertube.ketchup.noho.st", "https://yt.x1337x.fr", - "https://video.wsforum.net", "https://videos.rabbit-company.com", "https://video.paradigmthreat.net", "https://video.lincolncyber.com", @@ -781,7 +781,6 @@ "https://docker.videos.lecygnenoir.info", "https://tv.based.quest", "https://peertube.beardedtek.com", - "https://casnocensure.site", "https://creemoseducacioninclusiva.uma.es", "https://videos.yeswiki.net", "https://tube.lrk.sh", @@ -821,7 +820,6 @@ "https://swebbtube.se", "https://video.dnfi.no", "https://peertube.revelin.fr", - "https://video.wsf2021.info", "https://armstube.com", "https://peertube.ti-fr.com", "https://video.turbo.chat", @@ -949,7 +947,6 @@ "https://tube.communia.org", "https://peertube.dragonborn.app", "https://ai-tube.ch", - "https://buddhist.tv", "https://video.citizen4.eu", "https://video.matomocamp.org", "https://media.fsfe.org", @@ -1301,7 +1298,6 @@ "https://kino.schuerz.at", "https://peertube.tiennot.net", "https://tututu.tube", - "https://peertube.interhop.org", "https://tube.picasoft.net", "https://www.wiki-tube.de", "https://videos.pair2jeux.tube", -- cgit 1.4.1 From 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Fri, 22 Jul 2022 05:19:21 +0000 Subject: Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c80a614..dc24c751 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to alternative privacy friendly frontends and backends. -[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect:tokhmi.xyz) +[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect-space:matrix.org) [![Firefox users Badge](https://img.shields.io/amo/users/libredirect?label=Firefox%20users)](https://addons.mozilla.org/firefox/addon/libredirect/) -[![Matrix Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect) +[![LibrePay Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect) [![Firefox Add-on](./img/badge-amo.png)](https://addons.mozilla.org/firefox/addon/libredirect/)  -- cgit 1.4.1 From a35bee150f2d4f1416efe29585afe95999c8daab Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 24 Jul 2022 08:48:19 +0000 Subject: update instances --- src/instances/blacklist.json | 6 ---- src/instances/data.json | 69 +++++++------------------------------------- 2 files changed, 10 insertions(+), 65 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 4377c018..df438be1 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -8,11 +8,8 @@ "https://piped.mha.fi", "https://piped.shimul.me", "https://pipedus.palash.dev", -<<<<<<< HEAD -======= "https://piped.waffle.wiki", "https://watch.whatever.social", ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "https://nitter.domain.glass", "https://birdsite.xanny.family", "https://nitter.moomoo.me", @@ -23,10 +20,7 @@ "https://twitter.dr460nf1r3.org", "https://nitter.garudalinux.org", "https://nitter.wef.lol", -<<<<<<< HEAD "https://nitter.catalyst.sx", -======= ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "https://nitter.fprivacy.com", "https://bib.actionsack.com", "https://libreddit.domain.glass", diff --git a/src/instances/data.json b/src/instances/data.json index c754bade..0567849f 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -8,7 +8,6 @@ "https://inv.riverside.rocks", "https://invidious.osi.kr", "https://y.com.sb", - "https://yt.artemislena.eu", "https://invidious.flokinet.to", "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", @@ -20,7 +19,8 @@ "https://youtube.076.ne.jp", "https://invidious.esmailelbob.xyz", "https://invidious.weblibre.org", - "https://invidious.namazso.eu" + "https://invidious.namazso.eu", + "https://yt.artemislena.eu" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -46,16 +46,13 @@ "https://piped.mha.fi", "https://piped.shimul.me", "https://pipedus.palash.dev", -<<<<<<< HEAD -======= "https://piped.waffle.wiki", "https://watch.whatever.social", ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "https://yt.jae.fi", "https://piped.mint.lgbt", "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", - "https://piped.projectsegfau.lt/" + "https://piped.projectsegfau.lt" ], "tor": [ "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" @@ -173,7 +170,6 @@ "https://nitter.projectsegfau.lt", "https://singapore.unofficialbird.com", "https://twt.funami.tech", -<<<<<<< HEAD "https://nitter.fprivacy.com", "https://canada.unofficialbird.com", "https://india.unofficialbird.com", @@ -181,9 +177,6 @@ "https://uk.unofficialbird.com", "https://n.l5.ca", "https://nitter.slipfox.xyz" -======= - "https://nitter.fprivacy.com" ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 ], "tor": [ "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", @@ -463,24 +456,11 @@ "loki": [] }, "searx": { -<<<<<<< HEAD -======= - "tor": [ - "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", - "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", - "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" - ], - "i2p": [ - "http://ransack.i2p", - "http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p" - ], ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "normal": [ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", + "https://private-searx.ml", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -506,7 +486,6 @@ "https://searx.tuxcloud.net", "https://searx.tyil.nl", "https://searx.vanwa.tech", - "https://searx.vimproved.me", "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", @@ -520,27 +499,14 @@ "https://searx.roflcopter.fr" ], "tor": [ -<<<<<<< HEAD "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", + "http://x5gdjh6t7kb4yubpufhtc3l3df2acev3emxdasd5vyuyoon5rzf5zkyd.onion", + "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" -======= - "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", - "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", - "http://x5gdjh6t7kb4yubpufhtc3l3df2acev3emxdasd5vyuyoon5rzf5zkyd.onion", - "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", - "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", - "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", - "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", - "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", - "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", - "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", - "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion" ], "i2p": [ "http://ransack.i2p", @@ -559,7 +525,6 @@ "https://opnxng.com", "https://paulgo.io", "https://priv.au", - "https://private-searx.ml", "https://privatus.live", "https://s.frlt.one", "https://s.zhaocloud.net", @@ -580,10 +545,7 @@ "https://search.sapti.me", "https://search.teamriverbubbles.com", "https://search.unlocked.link", -<<<<<<< HEAD "https://search.vidhukant.xyz", -======= ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "https://search.zzls.xyz", "https://searx.be", "https://searx.becomesovran.com", @@ -606,6 +568,7 @@ "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", + "https://searx.vimproved.me", "https://searx.youshitsune.me", "https://searx.zcyph.cc", "https://searxng.au/searx", @@ -619,15 +582,13 @@ "https://xcxc.ml" ], "tor": [ + "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", - "http://x5gdjh6t7kb4yubpufhtc3l3df2acev3emxdasd5vyuyoon5rzf5zkyd.onion", - "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", - "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" @@ -689,7 +650,6 @@ "http://rimgo.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", "http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://rimgo.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" -<<<<<<< HEAD ], "i2p": [], "loki": [] @@ -702,8 +662,6 @@ "https://lbry.mutahar.rocks", "https://librarian.esmailelbob.xyz", "https://lbry.vern.cc" -======= ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 ], "tor": [ "http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", @@ -713,7 +671,6 @@ "loki": [] }, "peertube": [ -<<<<<<< HEAD "https://pire.artisanlogiciel.net", "https://trutube.xyz", "https://tube-test.apps.education.fr", @@ -809,8 +766,6 @@ "https://peertube.otakufarms.com", "https://tube.motuhake.xyz", "https://pt.m0r016.net", -======= ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "https://hitchtube.fr", "https://video.fox-romka.ru", "https://peertube.ctrl-c.liu.se", @@ -981,10 +936,6 @@ "https://tube.globalfrens.com", "https://peertube.hacknews.pmdcollab.org", "https://freetubes.nohost.me", -<<<<<<< HEAD -======= - "https://video.simplex-software.ru", ->>>>>>> 468f9ff12cb88cf67ce14aa533f8c1c709923ff7 "https://video.snug.moe", "https://video.avant-le-strike.buzz", "https://videos.ritimo.org", -- cgit 1.4.1 From 46d75b4d8c59fa98f62cfc12ca14fd314f0b6ba6 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 24 Jul 2022 09:44:39 +0000 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e424d12..acfe7010 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to alternative privacy friendly frontends and backends. -[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect-space:matrix.org) +[![Matrix Badge](https://img.shields.io/matrix/libredirect-space:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect-space:matrix.org) [![Firefox users Badge](https://img.shields.io/amo/users/libredirect?label=Firefox%20users)](https://addons.mozilla.org/firefox/addon/libredirect/) [![LibrePay Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect) -- cgit 1.4.1 From b2a24fbb9962b5ed5c13cd1ce34d2aa9c2ad0346 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 24 Jul 2022 09:46:29 +0000 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acfe7010..6e424d12 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to alternative privacy friendly frontends and backends. -[![Matrix Badge](https://img.shields.io/matrix/libredirect-space:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect-space:matrix.org) +[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect-space:matrix.org) [![Firefox users Badge](https://img.shields.io/amo/users/libredirect?label=Firefox%20users)](https://addons.mozilla.org/firefox/addon/libredirect/) [![LibrePay Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect) -- 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(+) 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(-) 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(+) 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 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(-) 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(+) 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(-) 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 f19d203e9e3a26810b730e9a8ea77ce3d18eb26d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 25 Jul 2022 22:33:38 +0000 Subject: update instances --- src/instances/blacklist.json | 1 + src/instances/data.json | 41 +++++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index df438be1..54b7fe0b 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -13,6 +13,7 @@ "https://nitter.domain.glass", "https://birdsite.xanny.family", "https://nitter.moomoo.me", + "https://nitter.it", "https://notabird.site", "https://fuckthesacklers.network", "https://nitter.winscloud.net", diff --git a/src/instances/data.json b/src/instances/data.json index 0567849f..b74d0622 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -8,6 +8,7 @@ "https://inv.riverside.rocks", "https://invidious.osi.kr", "https://y.com.sb", + "https://yt.artemislena.eu", "https://invidious.flokinet.to", "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", @@ -15,12 +16,12 @@ "https://invidious.projectsegfau.lt", "https://inv.vern.cc", "https://invidious.nerdvpn.de", + "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", + "https://invidious.weblibre.org", "https://youtube.076.ne.jp", "https://invidious.esmailelbob.xyz", - "https://invidious.weblibre.org", - "https://invidious.namazso.eu", - "https://yt.artemislena.eu" + "https://invidious.namazso.eu" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -394,7 +395,8 @@ "https://wuetre.herokuapp.com", "https://quetreus.herokuapp.com", "https://quetre.tokhmi.xyz", - "https://quetre.projectsegfau.lt" + "https://quetre.projectsegfau.lt", + "https://quetre.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -405,7 +407,8 @@ "https://libremdb.herokuapp.com", "https://libremdb.pussthecat.org", "https://libremdbeu.herokuapp.com", - "https://lmdb.tokhmi.xyz" + "https://lmdb.tokhmi.xyz", + "https://libremdb.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -460,7 +463,6 @@ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", - "https://private-searx.ml", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -476,6 +478,7 @@ "https://searx.netzspielplatz.de", "https://searx.nixnet.services", "https://searx.org", + "https://searx.priv.pw", "https://searx.pwoss.org", "https://searx.rasp.fr", "https://searx.ru", @@ -500,13 +503,10 @@ ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://x5gdjh6t7kb4yubpufhtc3l3df2acev3emxdasd5vyuyoon5rzf5zkyd.onion", - "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" ], "i2p": [ "http://ransack.i2p", @@ -528,6 +528,7 @@ "https://privatus.live", "https://s.frlt.one", "https://s.zhaocloud.net", + "https://saber.tk", "https://search.affusio.com", "https://search.ashs.club", "https://search.bingowaves.xyz", @@ -556,12 +557,10 @@ "https://searx.fi", "https://searx.fmac.xyz", "https://searx.gnous.eu", - "https://searx.loafland.xyz", "https://searx.mha.fi", "https://searx.mistli.net", "https://searx.namejeff.xyz", "https://searx.orion-hub.fr", - "https://searx.priv.pw", "https://searx.prvcy.eu", "https://searx.rimkus.it", "https://searx.sethforprivacy.com", @@ -584,11 +583,13 @@ "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", + "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" @@ -671,6 +672,7 @@ "loki": [] }, "peertube": [ + "https://soberania.tv", "https://pire.artisanlogiciel.net", "https://trutube.xyz", "https://tube-test.apps.education.fr", @@ -1025,7 +1027,6 @@ "https://peertube.marud.fr", "https://freetubehub.live", "https://peertube.librelabucm.org", - "https://tube4.apolut.net", "https://mtube.mooo.com", "https://skeptube.fr", "https://tube.villejuif.fr", @@ -1042,7 +1043,6 @@ "https://open.movie", "https://tube.rfc1149.net", "https://tube.radiomercure.fr", - "https://medias.debrouillonet.org", "https://peertube.1984.cz", "https://tube.sp4ke.com", "https://pt.nix.uno", @@ -1074,7 +1074,6 @@ "https://dud-video.inf.tu-dresden.de", "https://media-test.interior.edu.uy", "https://media.interior.edu.uy", - "https://peertube.la-scic.fr", "https://phoenixproject.group", "https://peertube.sebu77.com", "https://www.orion-hub.fr", @@ -1132,7 +1131,6 @@ "https://tube.geekyboo.net", "https://notretube.asselma.eu", "https://canal.facil.services", - "https://ukva.li", "https://pt.gordons.gen.nz", "https://tube.misterbanal.net", "https://peertube.fomin.site", @@ -1228,7 +1226,6 @@ "https://kino.kompot.si", "https://tube.kockatoo.org", "https://peertube.cabaal.net", - "https://sovran.video", "https://stream.k-prod.fr", "https://tube.tylerdavis.xyz", "https://video.marcorennmaus.de", @@ -1443,7 +1440,6 @@ "https://peertube.tspu.edu.ru", "https://p.lu", "https://serv3.wiki-tube.de", - "https://serv1.wiki-tube.de", "https://video.lavolte.net", "https://peertube.public.cat", "https://peertube.anduin.net", @@ -1511,7 +1507,6 @@ "https://video.pony.gallery", "https://tube.skrep.in", "https://tube.others.social", - "https://videos.ubuntu-paris.org", "https://tube-poitiers.beta.education.fr", "https://vid.wildeboer.net", "https://battlepenguin.video", @@ -1715,6 +1710,12 @@ "https://peertube.qtg.fr", "https://tube.p2p.legal", "https://troll.tv", - "https://videos.iut-orsay.fr" + "https://videos.iut-orsay.fr", + "https://peertube.solidev.net", + "https://videos.cemea.org", + "https://video.passageenseine.fr", + "https://peertube.touhoppai.moe", + "https://share.tube", + "https://peertube.heraut.eu" ] } \ No newline at end of file -- 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(-) 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 a9d3245a0ade677070559da3bd72aa906808cc8a Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 11:25:41 +0100 Subject: Resolve issue with instagram not redirecting after going back a page Closes https://github.com/libredirect/libredirect/issues/389 --- src/assets/javascripts/instagram.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 2e4503e7..45a27cb2 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -78,8 +78,8 @@ browser.storage.onChanged.addListener(init) function all() { return [ - ...instagramRedirects.bibliogram.normal, - ...instagramRedirects.bibliogram.tor, + ...bibliogramNormalRedirectsChecks, + ...bibliogramTorRedirectsChecks, ...bibliogramNormalCustomRedirects, ...bibliogramTorCustomRedirects, ...bibliogramI2pCustomRedirects, @@ -89,8 +89,8 @@ function all() { function redirect(url, type, initiator, disableOverride) { if (disableInstagram && !disableOverride) return - if (initiator && all().includes(initiator.origin)) return "BYPASSTAB" if (!targets.includes(url.host)) return + if (initiator && all().includes(initiator.origin)) return "BYPASSTAB" if (!["main_frame", "sub_frame", "xmlhttprequest", "other", "image", "media"].includes(type)) return const bypassPaths = [/about/, /explore/, /support/, /press/, /api/, /privacy/, /safety/, /admin/, /\/(accounts\/|embeds?.js)/] -- cgit 1.4.1 From 7a32d78398a343f5dfac51b6f53c333c16ae784a Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 11:40:01 +0100 Subject: Add new frontends to readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de3788b6..cc2fcc89 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to altern     -Youtube => [Invidious](https://github.com/iv-org/invidious), [Piped](https://github.com/TeamPiped/Piped), [Piped-Material](https://github.com/mmjee/Piped-Material), [FreeTube](https://github.com/FreeTubeApp/FreeTube), [Yattee](https://github.com/yattee/yattee)\ -Youtube Music => [Beatbump](https://github.com/snuffyDev/Beatbump)\ +Youtube => [Invidious](https://github.com/iv-org/invidious), [Piped](https://github.com/TeamPiped/Piped), [Piped-Material](https://github.com/mmjee/Piped-Material), [CloudTube](https://sr.ht/~cadence/tube/) [FreeTube](https://github.com/FreeTubeApp/FreeTube), [Yattee](https://github.com/yattee/yattee)\ +Youtube Music => [Beatbump](https://github.com/snuffyDev/Beatbump), [Hyperpipe](https://codeberg.org/Hyperpipe/Hyperpipe)\ Twitter => [Nitter](https://github.com/zedeus/nitter)\ Instagram => [Bibliogram](https://sr.ht/~cadence/bibliogram/)\ TikTok => [ProxiTok](https://github.com/pablouser1/ProxiTok)\ @@ -31,7 +31,7 @@ Medium => [Scribe](https://sr.ht/~edwardloveall/scribe/)\ Quora => [Quetre](https://github.com/zyachel/quetre)\ IMDb => [Libremdb](https://github.com/zyachel/libremdb)\ PeerTube => [SimpleerTube](https://git.sr.ht/~metalune/simpleweb_peertube)\ -LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian)\ +LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian) [LBRY Desktop](https://lbry.com/get)\ Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [Librex](https://github.com/hnhx/librex/)\ Translate => [SimplyTranslate](https://git.sr.ht/~metalune/simplytranslate_web), [LingvaTranslate](https://github.com/TheDavidDelta/lingva-translate)\ Maps => [OpenStreetMap](https://www.openstreetmap.org/), [FacilMap](https://github.com/FacilMap/facilmap)\ -- cgit 1.4.1 From ab1e22459ea382c21077234db1529e8371299860 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 11:40:44 +0100 Subject: , --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc2fcc89..10539b3d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Medium => [Scribe](https://sr.ht/~edwardloveall/scribe/)\ Quora => [Quetre](https://github.com/zyachel/quetre)\ IMDb => [Libremdb](https://github.com/zyachel/libremdb)\ PeerTube => [SimpleerTube](https://git.sr.ht/~metalune/simpleweb_peertube)\ -LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian) [LBRY Desktop](https://lbry.com/get)\ +LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian), [LBRY Desktop](https://lbry.com/get)\ Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [Librex](https://github.com/hnhx/librex/)\ Translate => [SimplyTranslate](https://git.sr.ht/~metalune/simplytranslate_web), [LingvaTranslate](https://github.com/TheDavidDelta/lingva-translate)\ Maps => [OpenStreetMap](https://www.openstreetmap.org/), [FacilMap](https://github.com/FacilMap/facilmap)\ -- cgit 1.4.1 From d71c2b1e6f95633eb36a6d27012bd92d48ed21ee Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 12:43:08 +0100 Subject: , --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10539b3d..611ee14e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to altern     -Youtube => [Invidious](https://github.com/iv-org/invidious), [Piped](https://github.com/TeamPiped/Piped), [Piped-Material](https://github.com/mmjee/Piped-Material), [CloudTube](https://sr.ht/~cadence/tube/) [FreeTube](https://github.com/FreeTubeApp/FreeTube), [Yattee](https://github.com/yattee/yattee)\ +Youtube => [Invidious](https://github.com/iv-org/invidious), [Piped](https://github.com/TeamPiped/Piped), [Piped-Material](https://github.com/mmjee/Piped-Material), [CloudTube](https://sr.ht/~cadence/tube/), [FreeTube](https://github.com/FreeTubeApp/FreeTube), [Yattee](https://github.com/yattee/yattee)\ Youtube Music => [Beatbump](https://github.com/snuffyDev/Beatbump), [Hyperpipe](https://codeberg.org/Hyperpipe/Hyperpipe)\ Twitter => [Nitter](https://github.com/zedeus/nitter)\ Instagram => [Bibliogram](https://sr.ht/~cadence/bibliogram/)\ -- cgit 1.4.1 From 1d0df109b3fcffbe15bf1d79b1dfdcc026b12383 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 16:57:15 +0100 Subject: Cleaned up nitter regex --- src/instances/get_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 5edbfb68..e19bfbbe 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -191,7 +191,7 @@ def send(): def nitter(): r = requests.get('https://raw.githubusercontent.com/wiki/zedeus/nitter/Instances.md') tmp = re.findall( - r"(?:(?:\| \[(?:\S+\.)+[a-zA-Z]+\]\((https?:\/{2}(?:\S+\.)+[a-zA-Z]+)\/?\) (?:\((?:\S+ ?\S*)\) )? *\| (?:✅|🇩🇪) +\|(?:(?:\n)|(?: (?:❌)|(?: ✅)|(?: ❓)|(?: \[))))|(?:- \[(?:\S+\.)+(?:(?:i2p)|(?:loki))\]\((https?:\/{2}(?:\S+\.)(?:(?:i2p)|(?:loki)))\/?\)))", r.text) + r"(?:(?:\| \[(?:\S+\.)+[a-zA-Z]+\]\((https?:\/{2}(?:\S+\.)+[a-zA-Z]+)\/?\) (?:\((?:\S+ ?\S*)\) )? *\| [^❌]{1,3} +\|(?:(?:\n)|(?: (?:❌)|(?: ✅)|(?: ❓)|(?: \[))))|(?:- \[(?:\S+\.)+(?:(?:i2p)|(?:loki))\]\((https?:\/{2}(?:\S+\.)(?:(?:i2p)|(?:loki)))\/?\)))", r.text) nitterList = {} nitterList['normal'] = [] -- cgit 1.4.1 From 31e71cb6009ffcdf79bc01cd0953e5808a3766d1 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 27 Jul 2022 16:13:53 +0000 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3bbf2b3e..3b7b91ab 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ npm run start ### Install temporarily open `about:addons`\ -click on the settings button below the addon search bar and select `debug add-on`\ +type in the address bar `about:debugging`\ press `load temporarily addon` ### Install in Firefox ESR, Developer Edition, Nightly -- cgit 1.4.1 From 6ae9616bc74d7bd189c2b1061c8fa3c89efea48d Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 27 Jul 2022 19:35:28 +0300 Subject: Removed piped.json --- src/instances/piped.json | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/instances/piped.json diff --git a/src/instances/piped.json b/src/instances/piped.json deleted file mode 100644 index 5076091d..00000000 --- a/src/instances/piped.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "normal": [ - "https://piped.kavin.rocks", - "https://piped.tokhmi.xyz", - "https://piped.moomoo.me", - "https://il.ax", - "https://piped.syncpundit.com", - "https://piped.mha.fi", - "https://piped.shimul.me", - "https://pipedus.palash.dev", - "https://piped.waffle.wiki", - "https://watch.whatever.social", - "https://yt.jae.fi", - "https://piped.mint.lgbt", - "https://piped.privacy.com.de", - "https://piped.esmailelbob.xyz", - "https://piped.projectsegfau.lt/" - ], - "tor": [ - "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" - ], - "i2p": [], - "loki": [] -} \ No newline at end of file -- cgit 1.4.1 From 532e01b49f44b77d78f12d8aa52a8703cb224358 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 27 Jul 2022 19:17:50 +0100 Subject: Fallback on codeberg for instance fetching --- src/assets/javascripts/utils.js | 96 ++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 7a97dcdb..9a7d37b3 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -40,53 +40,61 @@ async function initcloudflareBlackList() { function updateInstances() { return new Promise(async resolve => { let http = new XMLHttpRequest() + let fallback = new XMLHttpRequest() http.open("GET", "https://raw.githubusercontent.com/libredirect/libredirect/master/src/instances/data.json", false) http.send(null) - if (http.status === 200) { - await initcloudflareBlackList() - const instances = JSON.parse(http.responseText) - - youtubeHelper.setRedirects({ - invidious: instances.invidious, - piped: instances.piped, - pipedMaterial: instances.pipedMaterial, - }) - twitterHelper.setRedirects(instances.nitter) - instagramHelper.setRedirects(instances.bibliogram) - redditHelper.setRedirects({ - libreddit: instances.libreddit, - teddit: instances.teddit, - }) - translateHelper.setRedirects({ - simplyTranslate: instances.simplyTranslate, - lingva: instances.lingva, - }) - searchHelper.setRedirects({ - searx: instances.searx, - searxng: instances.searxng, - whoogle: instances.whoogle, - librex: instances.librex, - }) - wikipediaHelper.setRedirects(instances.wikiless) - mediumHelper.setRedirects(instances.scribe) - quoraHelper.setRedirects(instances.quetre) - libremdbHelper.setRedirects(instances.libremdb) - sendTargetsHelper.setRedirects(instances.send) - tiktokHelper.setRedirects(instances.proxiTok) - lbryHelper.setRedirects(instances.librarian) - reutersHelper.setRedirects(instances.neuters) - youtubeMusicHelper.setRedirects({ - beatbump: instances.beatbump, - hyperpipe: instances.hyperpipe, - }) - mapsHelper.setRedirects(instances.facil) - peertubeHelper.setRedirects(instances.simpleertube) - - console.info("Successfully updated Instances") - resolve(true) - return + if (http.status != 200) { + fallback.open("GET", "https://codeberg.org/LibRedirect/libredirect/raw/branch/master/src/instances/data.json", false) + fallback.send(null) + if (fallback.status === 200) { + http = fallback + } else { + resolve() + return + } } - resolve() + await initcloudflareBlackList() + const instances = JSON.parse(http.responseText) + + youtubeHelper.setRedirects({ + invidious: instances.invidious, + piped: instances.piped, + pipedMaterial: instances.pipedMaterial, + }) + twitterHelper.setRedirects(instances.nitter) + instagramHelper.setRedirects(instances.bibliogram) + redditHelper.setRedirects({ + libreddit: instances.libreddit, + teddit: instances.teddit, + }) + translateHelper.setRedirects({ + simplyTranslate: instances.simplyTranslate, + lingva: instances.lingva, + }) + searchHelper.setRedirects({ + searx: instances.searx, + searxng: instances.searxng, + whoogle: instances.whoogle, + librex: instances.librex, + }) + wikipediaHelper.setRedirects(instances.wikiless) + mediumHelper.setRedirects(instances.scribe) + quoraHelper.setRedirects(instances.quetre) + libremdbHelper.setRedirects(instances.libremdb) + sendTargetsHelper.setRedirects(instances.send) + tiktokHelper.setRedirects(instances.proxiTok) + lbryHelper.setRedirects(instances.librarian) + reutersHelper.setRedirects(instances.neuters) + youtubeMusicHelper.setRedirects({ + beatbump: instances.beatbump, + hyperpipe: instances.hyperpipe, + }) + mapsHelper.setRedirects(instances.facil) + peertubeHelper.setRedirects(instances.simpleertube) + + console.info("Successfully updated Instances") + resolve(true) + return }) } -- cgit 1.4.1 From 29295b82373f5ccdeee79afe70b7f21288c5c129 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Thu, 28 Jul 2022 17:30:38 +0100 Subject: Added lbry embeds and codeberg issue templates --- src/assets/javascripts/lbry.js | 70 ++++++++++++++++++++++---------------- src/pages/options/index.html | 8 +++++ src/pages/options/widgets/lbry.js | 5 ++- src/pages/options/widgets/lbry.pug | 7 ++++ 4 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index f0698d36..0c4d34cc 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -2,7 +2,7 @@ window.browser = window.browser || window.chrome import utils from "./utils.js" -let targets = ["odysee.com"] +const targets = [/^https?:\/{2}odysee\.com/] const frontends = new Array("librarian") const protocols = new Array("normal", "tor", "i2p", "loki") @@ -36,6 +36,7 @@ let disableLbryTargets, protocol, protocolFallback, lbryTargetsRedirects, + lbryRedirectType, librarianNormalRedirectsChecks, librarianNormalCustomRedirects, librarianTorRedirectsChecks, @@ -53,6 +54,7 @@ function init() { "protocol", "protocolFallback", "lbryTargetsRedirects", + "lbryRedirectType", "librarianNormalRedirectsChecks", "librarianNormalCustomRedirects", "librarianTorRedirectsChecks", @@ -67,6 +69,7 @@ function init() { protocol = r.protocol protocolFallback = r.protocolFallback lbryTargetsRedirects = r.lbryTargetsRedirects + lbryRedirectType = r.lbryRedirectType librarianNormalRedirectsChecks = r.librarianNormalRedirectsChecks librarianNormalCustomRedirects = r.librarianNormalCustomRedirects librarianTorRedirectsChecks = r.librarianTorRedirectsChecks @@ -86,6 +89,24 @@ function all() { return [...redirects.librarian.normal, ...redirects.librarian.tor, ...librarianNormalCustomRedirects, ...librarianTorCustomRedirects, ...librarianI2pCustomRedirects, ...librarianLokiCustomRedirects] } +function getInstancesList() { + let tmpList = [] + switch (protocol) { + case "loki": + tmpList = [...librarianLokiCustomRedirects] + break + case "i2p": + tmpList = [...librarianI2pRedirectsChecks, ...librarianI2pCustomRedirects] + break + case "tor": + tmpList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects] + } + if ((tmpList.length === 0 && protocolFallback) || protocol == "normal") { + tmpList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects] + } + return tmpList +} + function switchInstance(url, disableOverride) { return new Promise(async resolve => { await init() @@ -122,37 +143,27 @@ function switchInstance(url, disableOverride) { 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" || "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 = [] - 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 (!targets.some(rx => rx.test(url.href))) return + if ((type == "main_frame" && lbryRedirectType == "sub_frame") || (type == "sub_frame" && lbryRedirectType == "main_frame")) return + + const instancesList = getInstancesList() + switch (type) { + case "main_frame": + switch (lbryFrontend) { + case "librarian": + if (instancesList.length === 0) return + const randomInstance = utils.getRandomInstance(instancesList) + return `${randomInstance}${url.pathname}${url.search}` + case "lbryDesktop": + if (type == "main_frame") { + return url.href.replace(/^https?:\/{2}odysee\.com\//, "lbry://").replace(/:(?=[a-zA-Z0-9])/g, "#") + } } + case "sub_frame": if (instancesList.length === 0) return + const randomInstance = utils.getRandomInstance(instancesList) + return `${randomInstance}${url.pathname}${url.search}`.replace(/\/(?=[a-f0-9]{40})/, ":") } - const randomInstance = utils.getRandomInstance(instancesList) - return `${randomInstance}${url.pathname}${url.search}` } function initDefaults() { @@ -169,6 +180,7 @@ function initDefaults() { disableLbryTargets: true, lbryFrontend: "librarian", lbryTargetsRedirects: redirects, + lbryRedirectType: "both", librarianNormalRedirectsChecks: [...redirects.librarian.normal], librarianNormalCustomRedirects: [], diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 84955339..a868ad3a 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -2209,6 +2209,14 @@
+
+

Redirect Type

+ +

diff --git a/src/pages/options/widgets/lbry.js b/src/pages/options/widgets/lbry.js index 76e212cb..d50de843 100644 --- a/src/pages/options/widgets/lbry.js +++ b/src/pages/options/widgets/lbry.js @@ -5,6 +5,7 @@ const protocols = new Array("normal", "tor", "i2p", "loki") const enable = document.getElementById("lbry-enable") const lbry = document.getElementById("lbry_page") +const redirectType = document.getElementById("lbry-redirect_type") const frontend = document.getElementById("lbry-frontend") let protocol @@ -33,9 +34,10 @@ function changeProtocolSettings() { } } -browser.storage.local.get(["disableLbryTargets", "protocol", "lbryFrontend"], r => { +browser.storage.local.get(["disableLbryTargets", "protocol", "lbryFrontend", "lbryRedirectType"], r => { enable.checked = !r.disableLbryTargets protocol = r.protocol + redirectType.value = r.lbryRedirectType frontend.value = r.lbryFrontend changeFrontendsSettings() changeProtocolSettings() @@ -44,6 +46,7 @@ browser.storage.local.get(["disableLbryTargets", "protocol", "lbryFrontend"], r lbry.addEventListener("change", () => { browser.storage.local.set({ disableLbryTargets: !enable.checked, + lbryRedirectType: redirectType.value, lbryFrontend: frontend.value, }) changeFrontendsSettings() diff --git a/src/pages/options/widgets/lbry.pug b/src/pages/options/widgets/lbry.pug index 678b87d9..e4278438 100644 --- a/src/pages/options/widgets/lbry.pug +++ b/src/pages/options/widgets/lbry.pug @@ -12,6 +12,13 @@ section#lbry_page.option-block option(value="librarian") Librarian option(value="lbryDesktop" data-localise="__MSG_lbryDesktop__") LBRY Desktop + .some-block.option-block + h4(data-localise="__MSG_redirectType__") Redirect Type + select#lbry-redirect_type + option(value="both" data-localise="__MSG_both__") both + option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded + option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded + #librarian hr .normal -- cgit 1.4.1 From 84490eee8b31bc35fa2e868420294f8a697fc9b5 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Thu, 28 Jul 2022 17:31:18 +0100 Subject: codeberg issue templates --- .gitea/issue_template/bug.md | 31 +++++++++++++++++++++++++++++++ .gitea/issue_template/feature.md | 14 ++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .gitea/issue_template/bug.md create mode 100644 .gitea/issue_template/feature.md diff --git a/.gitea/issue_template/bug.md b/.gitea/issue_template/bug.md new file mode 100644 index 00000000..e5d081e3 --- /dev/null +++ b/.gitea/issue_template/bug.md @@ -0,0 +1,31 @@ +--- +name: "Report a bug" +about: "Is libredirect not behaving as expected? Report a bug so that it can be fixed as soon as possible." +lables: + - "Kind: Bug" +--- + +## What happened? + +## What did you expect to happen? + +## Steps to reproduce: + +1. +2. +3. + + + +## Debug information: + +Browser and version number: +Libredirect version: + +## Screenshots/Videos + + + +
+ +[ ] I have checked on codeberg and github and can confirm this issue is not a duplicate. diff --git a/.gitea/issue_template/feature.md b/.gitea/issue_template/feature.md new file mode 100644 index 00000000..96f9d1dc --- /dev/null +++ b/.gitea/issue_template/feature.md @@ -0,0 +1,14 @@ +--- +name: "Suggest a new feature" +about: "Is there something missing that you want to see in libredirect? Suggest a feature so it will exist in a future release." +lables: + - "Kind: Feature" +--- + +## Describe your current issue/inconvinience + +## Explain how this new feature will solve this + +
+ +[ ] I have checked on codeberg and github and can confirm this issue is not a duplicate. -- cgit 1.4.1 From 778274413560117426686be658650eb910a33dd4 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Thu, 28 Jul 2022 17:32:53 +0100 Subject: Fixed labels --- .gitea/issue_template/bug.md | 2 +- .gitea/issue_template/feature.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/issue_template/bug.md b/.gitea/issue_template/bug.md index e5d081e3..13de17e6 100644 --- a/.gitea/issue_template/bug.md +++ b/.gitea/issue_template/bug.md @@ -1,7 +1,7 @@ --- name: "Report a bug" about: "Is libredirect not behaving as expected? Report a bug so that it can be fixed as soon as possible." -lables: +labels: - "Kind: Bug" --- diff --git a/.gitea/issue_template/feature.md b/.gitea/issue_template/feature.md index 96f9d1dc..2b08ce22 100644 --- a/.gitea/issue_template/feature.md +++ b/.gitea/issue_template/feature.md @@ -1,7 +1,7 @@ --- name: "Suggest a new feature" about: "Is there something missing that you want to see in libredirect? Suggest a feature so it will exist in a future release." -lables: +labels: - "Kind: Feature" --- -- cgit 1.4.1 From b995308add8c5e522966a2b2e2e65dc685b44ef2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 28 Jul 2022 22:35:02 +0000 Subject: update instances --- src/instances/blacklist.json | 11 ++-- src/instances/data.json | 122 +++++++++++++++++++++++++++++++------------ 2 files changed, 95 insertions(+), 38 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 54b7fe0b..58a6a82d 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -4,16 +4,14 @@ "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://piped.shimul.me", + "https://us-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", "https://nitter.moomoo.me", - "https://nitter.it", "https://notabird.site", "https://fuckthesacklers.network", "https://nitter.winscloud.net", @@ -44,6 +42,8 @@ "https://teddit.garudalinux.org", "https://tedd.it", "https://wiki.604kph.xyz", + "https://lingva.garudalinux.org", + "https://translate.dr460nf1r3.org", "https://searx.org", "https://searx.run", "https://search.albony.xyz", @@ -51,9 +51,10 @@ "https://search.dr460nf1r3.org", "https://search.wef.lol", "https://i.actionsack.com", - "https://rimgo.encrypted-data.xyz" + "https://rimgo.encrypted-data.xyz", + "https://beatbump.ml" ], "authenticate": [ - "https://nitter.nixnet.services" + "https://nitter:nitter@nitter.nixnet.services" ] } \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index b74d0622..a983ab8c 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -2,11 +2,9 @@ "invidious": { "normal": [ "https://yewtu.be", - "https://vid.puffyan.us", "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", - "https://invidious.osi.kr", "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.flokinet.to", @@ -18,10 +16,12 @@ "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://invidious.weblibre.org", "https://youtube.076.ne.jp", "https://invidious.esmailelbob.xyz", - "https://invidious.namazso.eu" + "https://invidious.weblibre.org", + "https://vid.puffyan.us", + "https://invidious.namazso.eu", + "https://invidious.osi.kr" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -43,21 +43,17 @@ "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://il.ax", - "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://piped.shimul.me", + "https://us-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", - "https://piped.mint.lgbt", "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], - "tor": [ - "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" - ], + "tor": [], "i2p": [], "loki": [] }, @@ -72,6 +68,17 @@ "i2p": [], "loki": [] }, + "cloudtube": { + "normal": [ + "https://tube.cadence.moe", + "https://yt.beparanoid.de" + ], + "tor": [ + "http://yt.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion" + ], + "i2p": [], + "loki": [] + }, "proxiTok": { "normal": [ "https://proxitok.herokuapp.com", @@ -112,7 +119,7 @@ "https://nitter.net", "https://nitter.42l.fr", "https://nitter.pussthecat.org", - "https://nitter.nixnet.services", + "https://nitter:nitter@nitter.nixnet.services", "https://nitter.fdn.fr", "https://nitter.1d4.us", "https://nitter.kavin.rocks", @@ -180,12 +187,8 @@ "https://nitter.slipfox.xyz" ], "tor": [ - "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", - "http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion", "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", "http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion", - "http://nitter.v6vgyqpa7yefkorazmg5d5fimstmvm2vtbirt6676mt7qmllrcnwycqd.onion", - "http://i23nv6w3juvzlw32xzoxcqzktegd4i4fu3nmnc2ewv4ggiu4ledwklad.onion", "http://26oq3gioiwcmfojub37nz5gzbkdiqp7fue5kvye7d4txv4ny6fb4wwid.onion", "http://vfaomgh4jxphpbdfizkm5gbtjahmei234giqj4facbwhrfjtcldauqad.onion", "http://iwgu3cv7ywf3gssed5iqtavmrlszgsxazkmwwnt4h2kdait75thdyrqd.onion", @@ -206,8 +209,14 @@ "http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion", "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion" ], - "i2p": [], - "loki": [] + "i2p": [ + "http://axd6uavsstsrvstva4mzlzh4ct76rc6zdug3nxdgeitrzczhzf4q.b32.i2p", + "http://u6ikd6zndl3c4dsdq4mmujpntgeevdk5qzkfb57r4tnfeccrn2qa.b32.i2p", + "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p" + ], + "loki": [ + "http://nitter.priv.loki" + ] }, "bibliogram": { "normal": [ @@ -370,6 +379,7 @@ "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion" ], "i2p": [ + "http://wikiless.i2p", "http://hflqp2ejxygpj6cdwo3ogfieqmxw3b56w7dblt7bor2ltwk6kcfa.b32.i2p", "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p" ], @@ -452,7 +462,10 @@ "https://lingva.pussthecat.org", "https://translate.plausibility.cloud", "https://lingva.lunar.icu", - "https://lingva.opnxng.com" + "https://lingva.opnxng.com", + "https://translate.projectsegfau.lt", + "https://lingva.garudalinux.org", + "https://translate.dr460nf1r3.org" ], "tor": [], "i2p": [], @@ -460,8 +473,11 @@ }, "searx": { "normal": [ + "http://ransack.i2p", + "http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p", "https://anon.sx", "https://dynabyte.ca", + "https://icanfindit.online", "https://jsearch.pw", "https://search.ethibox.fr", "https://search.snopyta.org", @@ -478,8 +494,6 @@ "https://searx.netzspielplatz.de", "https://searx.nixnet.services", "https://searx.org", - "https://searx.priv.pw", - "https://searx.pwoss.org", "https://searx.rasp.fr", "https://searx.ru", "https://searx.run", @@ -491,6 +505,7 @@ "https://searx.vanwa.tech", "https://searx.webheberg.info", "https://searx.xyz", + "https://searx.youshitsune.me", "https://searx.zapashcanon.fr", "https://searxng.ir", "https://spot.ecloud.global", @@ -506,12 +521,10 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" - ], - "i2p": [ - "http://ransack.i2p", - "http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], + "i2p": [], "loki": [] }, "searxng": { @@ -519,7 +532,6 @@ "https://darmarit.org/searx", "https://de.xcxc.ml", "https://etsi.me", - "https://icanfindit.online", "https://jackgoss.xyz", "https://northboot.xyz", "https://opnxng.com", @@ -561,6 +573,7 @@ "https://searx.mistli.net", "https://searx.namejeff.xyz", "https://searx.orion-hub.fr", + "https://searx.priv.pw", "https://searx.prvcy.eu", "https://searx.rimkus.it", "https://searx.sethforprivacy.com", @@ -568,17 +581,18 @@ "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", "https://searx.vimproved.me", - "https://searx.youshitsune.me", "https://searx.zcyph.cc", "https://searxng.au/searx", "https://searxng.tordenskjold.de", "https://searxng.zackptg5.com", "https://serx.ml", + "https://sh0.it", "https://srx.cosmohub.io", "https://swag.pw", "https://www.gruble.de", "https://www.webrats.xyz", - "https://xcxc.ml" + "https://xcxc.ml", + "https://xo.wtf" ], "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", @@ -587,7 +601,6 @@ "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", @@ -637,6 +650,7 @@ "normal": [ "https://i.bcow.xyz", "https://rimgo.pussthecat.org", + "https://rimgo.totaldarkness.net", "https://rimgo.bus-hit.me", "https://rimgo.esmailelbob.xyz", "https://rimgo.lunar.icu", @@ -671,6 +685,48 @@ "i2p": [], "loki": [] }, + "neuters": { + "normal": [ + "https://neuters.de" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "beatbump": { + "normal": [ + "https://beatbump.ml" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "hyperpipe": { + "normal": [ + "https://hyperpipe.surge.sh" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "facil": { + "normal": [ + "https://facilmap.org" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "simpleertube": { + "normal": [ + "https://tube.simple-web.org", + "https://simpleertube.esmailelbob.xyz", + "https://stube.tokhmi.xyz" + ], + "tor": [], + "i2p": [], + "loki": [] + }, "peertube": [ "https://soberania.tv", "https://pire.artisanlogiciel.net", @@ -795,7 +851,6 @@ "https://peertube.chaunchy.com", "https://tube.vrpnet.org", "https://video.tii.space", - "https://peertube.familleboisteau.fr", "https://peertube.inubo.ch", "https://nightshift.minnix.dev", "https://tube.friloux.me", @@ -931,7 +986,6 @@ "https://videos.slownewsdayshow.com", "https://videos.sarcasmstardust.com", "https://videos.factsonthegroundshow.com", - "https://video.regenpfeifer.net", "https://video.pe6.eu", "https://tv.santic-zombie.ru", "https://tube.sleeping.town", @@ -1517,7 +1571,6 @@ "https://peertube.davigge.com", "https://vod.ksite.de", "https://tube.grin.hu", - "https://media.inno3.cricket", "https://tube.cryptography.dog", "https://peertube.zergy.net", "https://vid.ncrypt.at", @@ -1716,6 +1769,9 @@ "https://video.passageenseine.fr", "https://peertube.touhoppai.moe", "https://share.tube", - "https://peertube.heraut.eu" + "https://peertube.heraut.eu", + "https://peertube.gegeweb.eu", + "https://framatube.org", + "https://tube.conferences-gesticulees.net" ] } \ No newline at end of file -- cgit 1.4.1 From 9b30663111b66c28613187b6039265023284f36d Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Fri, 29 Jul 2022 10:31:44 +0100 Subject: Minor spelling mistake --- src/instances/get_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index e19bfbbe..0d0e8c78 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -431,7 +431,7 @@ def searx_searxng(): searxngList['tor'].append(item[:-1]) else: searxList['tor'].append(item[:-1]) - elif re.search(torRegex, item[:-1]): + elif re.search(i2pRegex, item[:-1]): if (rJson['instances'][item].get('generator') == 'searxng'): searxngList['i2p'].append(item[:-1]) else: -- cgit 1.4.1 From 0b6c71778fa380849ab1949fa4ba1b999a911cdb Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 31 Jul 2022 22:35:05 +0000 Subject: update instances --- src/instances/blacklist.json | 2 -- src/instances/data.json | 56 ++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 58a6a82d..ec77035a 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -11,7 +11,6 @@ "https://watch.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", - "https://nitter.moomoo.me", "https://notabird.site", "https://fuckthesacklers.network", "https://nitter.winscloud.net", @@ -24,7 +23,6 @@ "https://bib.actionsack.com", "https://libreddit.domain.glass", "https://r.nf", - "https://libreddit.flux.industries", "https://lr.oversold.host", "https://libreddit.hu", "https://lr.stilic.ml", diff --git a/src/instances/data.json b/src/instances/data.json index a983ab8c..0b95bda7 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -2,9 +2,11 @@ "invidious": { "normal": [ "https://yewtu.be", + "https://vid.puffyan.us", "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", + "https://invidious.osi.kr", "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.flokinet.to", @@ -16,12 +18,10 @@ "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://youtube.076.ne.jp", - "https://invidious.esmailelbob.xyz", "https://invidious.weblibre.org", - "https://vid.puffyan.us", + "https://youtube.076.ne.jp", "https://invidious.namazso.eu", - "https://invidious.osi.kr" + "https://invidious.esmailelbob.xyz" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -49,6 +49,7 @@ "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", + "https://piped.mint.lgbt", "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" @@ -391,7 +392,8 @@ "https://scribe.nixnet.services", "https://scribe.citizen4.eu", "https://scribe.bus-hit.me", - "https://scribe.froth.zone" + "https://scribe.froth.zone", + "https://scribe.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -473,11 +475,8 @@ }, "searx": { "normal": [ - "http://ransack.i2p", - "http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p", "https://anon.sx", "https://dynabyte.ca", - "https://icanfindit.online", "https://jsearch.pw", "https://search.ethibox.fr", "https://search.snopyta.org", @@ -486,6 +485,7 @@ "https://searx.bissisoft.com", "https://searx.divided-by-zero.eu", "https://searx.dresden.network", + "https://searx.ebnar.xyz", "https://searx.fossencdi.org", "https://searx.gnu.style", "https://searx.mastodontech.de", @@ -505,7 +505,6 @@ "https://searx.vanwa.tech", "https://searx.webheberg.info", "https://searx.xyz", - "https://searx.youshitsune.me", "https://searx.zapashcanon.fr", "https://searxng.ir", "https://spot.ecloud.global", @@ -522,9 +521,12 @@ "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" + "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx" + ], + "i2p": [ + "http://ransack.i2p", + "http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p" ], - "i2p": [], "loki": [] }, "searxng": { @@ -563,7 +565,6 @@ "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", - "https://searx.ebnar.xyz", "https://searx.ericaftereric.top", "https://searx.esmailelbob.xyz", "https://searx.fi", @@ -597,13 +598,14 @@ "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", - "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" ], @@ -676,11 +678,13 @@ "https://librarian.pussthecat.org", "https://lbry.mutahar.rocks", "https://librarian.esmailelbob.xyz", - "https://lbry.vern.cc" + "https://lbry.vern.cc", + "https://lbry.slipfox.xyz" ], "tor": [ "http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion" ], "i2p": [], "loki": [] @@ -703,7 +707,8 @@ }, "hyperpipe": { "normal": [ - "https://hyperpipe.surge.sh" + "https://hyperpipe.surge.sh", + "https://hyperpipe.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -728,6 +733,9 @@ "loki": [] }, "peertube": [ + "https://www.neptube.io", + "https://tube.ghk-academy.info", + "https://pcbu.nl", "https://soberania.tv", "https://pire.artisanlogiciel.net", "https://trutube.xyz", @@ -784,7 +792,6 @@ "https://video.occm.cc", "https://peertube.viviers-fibre.net", "https://tube-action-educative.apps.education.fr", - "https://themadlads.live", "https://jahve.pl", "https://videos.yesil.club", "https://peertube.adjutor.xyz", @@ -843,7 +850,6 @@ "https://videos.neongarden.life", "https://video.vaku.org.ua", "https://videos.trom.lt", - "https://videod.fr", "https://vid.mkp.ca", "https://jupiter.tube", "https://tuvideo.encanarias.info", @@ -905,7 +911,6 @@ "https://tube.rooty.fr", "https://tube.dnet.one", "https://peertube.io", - "https://peertube.echelon4.space", "https://www.kotikoff.net", "https://peertube.nz", "https://videos.grafo.zone", @@ -919,7 +924,6 @@ "https://krdtube.org", "https://peertube.elforcer.ru", "https://tubocatodico.bida.im", - "https://linhtran.eu", "https://torstenwitte.peertube-host.de", "https://peertube.hackerfraternity.org", "https://openmedia.edunova.it", @@ -997,7 +1001,6 @@ "https://videos.ritimo.org", "https://videos.ephphatha.church", "https://video.cerclearistote.com", - "https://computerstuff.mooo.com", "https://video.greenmycity.eu", "https://przej.me", "https://pt.mezzo.moe", @@ -1098,7 +1101,6 @@ "https://tube.rfc1149.net", "https://tube.radiomercure.fr", "https://peertube.1984.cz", - "https://tube.sp4ke.com", "https://pt.nix.uno", "https://videos.openmandriva.org", "https://video.vanderwarker.photos", @@ -1237,7 +1239,6 @@ "https://tube.okcinfo.news", "https://www.rocaguinarda.tv", "https://videos.wirtube.de", - "https://tube.tinfoil-hat.net", "https://livegram.net", "https://video.ustim.ru", "https://merci-la-police.fr", @@ -1435,9 +1436,7 @@ "https://video.taboulisme.com", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", - "https://veezee.tube", "https://peertube.nicolastissot.fr", - "https://s2.veezee.tube", "https://tubes.jodh.us", "https://tube.lucie-philou.com", "https://video.odayacres.farm", @@ -1772,6 +1771,11 @@ "https://peertube.heraut.eu", "https://peertube.gegeweb.eu", "https://framatube.org", - "https://tube.conferences-gesticulees.net" + "https://tube.conferences-gesticulees.net", + "https://peertube.datagueule.tv", + "https://video.lqdn.fr", + "https://peertube3.cpy.re", + "https://peertube2.cpy.re", + "https://peertube.cpy.re" ] } \ No newline at end of file -- cgit 1.4.1 From 4c69fa7e292a3896ef5f4daf1e6dea3c9bd0b446 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Mon, 1 Aug 2022 13:31:16 +0100 Subject: Latency threshold, LBRY/Odysee -> LBRY Closes https://github.com/libredirect/libredirect/pull/405 --- src/assets/images/imgur-icon.png | Bin 26675 -> 0 bytes src/assets/images/imgur.png | Bin 0 -> 26675 bytes src/assets/javascripts/general.js | 1 + src/assets/javascripts/utils.js | 63 +++++++++++++++++++++++++++------- src/pages/options/index.html | 15 +++++--- src/pages/options/index.pug | 2 +- src/pages/options/widgets/general.pug | 10 ++++-- src/pages/popup/popup.html | 4 +-- src/pages/popup/popup.pug | 2 +- 9 files changed, 74 insertions(+), 23 deletions(-) delete mode 100644 src/assets/images/imgur-icon.png create mode 100644 src/assets/images/imgur.png diff --git a/src/assets/images/imgur-icon.png b/src/assets/images/imgur-icon.png deleted file mode 100644 index c23a45b2..00000000 Binary files a/src/assets/images/imgur-icon.png and /dev/null differ diff --git a/src/assets/images/imgur.png b/src/assets/images/imgur.png new file mode 100644 index 00000000..c23a45b2 Binary files /dev/null and b/src/assets/images/imgur.png differ diff --git a/src/assets/javascripts/general.js b/src/assets/javascripts/general.js index 0b34c148..113dc6f7 100644 --- a/src/assets/javascripts/general.js +++ b/src/assets/javascripts/general.js @@ -32,6 +32,7 @@ async function initDefaults() { firstPartyIsolate: false, protocol: "normal", protocolFallback: true, + latencyThreshold: 1000 }, () => resolve() ) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 9a7d37b3..52848de7 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -247,34 +247,65 @@ async function processDefaultCustomInstances(target, name, protocol, document) { }) } -async function ping(href) { +function ping(href) { return new Promise(async resolve => { + let average = 0 + let time + for (let i = 0; i < 3; i++) { + time = await pingOnce(href) + if (i == 0) continue + if (time >= 5000) { + resolve(time) + return + } + average += time + } + average = parseInt(average / 3) + resolve(average) + }) +} + +function pingOnce(href) { + return new Promise(async resolve => { + let started let http = new XMLHttpRequest() - http.open("GET", `${href}?_=${new Date().getTime()}`, /*async*/ true) http.timeout = 5000 - let started = new Date().getTime() + http.ontimeout = () => resolve(5000) + http.onerror = () => resolve() http.onreadystatechange = () => { if (http.readyState == 2) { if (http.status == 200) { let ended = new Date().getTime() http.abort() resolve(ended - started) - } else resolve(5000 + http.status) + } else { + resolve(5000 + http.status) + } } + } - http.ontimeout = () => resolve(5000) - http.onerror = () => resolve() - try { - http.send(null) - } catch (exception) { - resolve() - } + http.open("GET", `${href}?_=${new Date().getTime()}`, true) + started = new Date().getTime() + http.send(null) }) } + -async function testLatency(element, instances) { +async function testLatency(element, instances, frontend) { return new Promise(async resolve => { let myList = {} + let latencyThreshold + let redirectsChecks = [] + browser.storage.local.get( + [ + "latencyThreshold", + `${frontend}NormalRedirectsChecks` + ], + r => { + latencyThreshold = r.latencyThreshold + redirectsChecks = r[`${frontend}NormalRedirectsChecks`] + } + ) for (const href of instances) await ping(href).then(time => { if (time) { @@ -284,6 +315,12 @@ async function testLatency(element, instances) { else if (time <= 2000) color = "orange" else color = "red" + if (time > latencyThreshold) { + redirectsChecks.splice(redirectsChecks.indexOf(href), 1) + } + + browser.storage.local.set({ [`${frontend}NormalRedirectsChecks`]: redirectsChecks }) + let text if (time == 5000) text = "5000ms+" else if (time > 5000) text = `ERROR: ${time - 5000}` @@ -487,7 +524,7 @@ function latency(name, frontend, document, location) { let redirects = r[key] const oldHtml = latencyLabel.innerHTML latencyLabel.innerHTML = "..." - testLatency(latencyLabel, redirects[frontend].normal).then(r => { + testLatency(latencyLabel, redirects[frontend].normal, frontend).then(r => { browser.storage.local.set({ [`${frontend}Latency`]: r }) latencyLabel.innerHTML = oldHtml processDefaultCustomInstances(name, frontend, "normal", document) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index a868ad3a..afad0bf9 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -21,7 +21,7 @@
- +
@@ -34,7 +34,7 @@ - +
@@ -94,6 +94,13 @@

+
+
+

Latency Threshold

+ + +
+

@@ -173,7 +180,7 @@
-
+
Imgur
@@ -254,7 +261,7 @@
- LBRY/Odysee + LBRY
diff --git a/src/pages/options/index.pug b/src/pages/options/index.pug index 553f918f..3711fdac 100644 --- a/src/pages/options/index.pug +++ b/src/pages/options/index.pug @@ -33,4 +33,4 @@ html#elementToShowWithJavaScript(lang="en") include ./widgets/sendTargets.pug include ./widgets/about.pug - script(type="module" src="./index.js") \ No newline at end of file + script(type="module" src="./index.js") diff --git a/src/pages/options/widgets/general.pug b/src/pages/options/widgets/general.pug index e04e9e2a..e523d5bb 100644 --- a/src/pages/options/widgets/general.pug +++ b/src/pages/options/widgets/general.pug @@ -31,6 +31,12 @@ section#general_page.option-block h4(data-localise="__MSG_autoRedirect__") input#auto-redirect(type="checkbox") + form + .some-block.option-block + h4(data-localise="__MSG_latencyThreshold") Latency Threshold + output#latency-output(for="latencyInput" name="latencyOutput") + input#latency-input(type="range" min="50" max="5000" value="1000" name="latencyInput" step="50") + .some-block.option-block h4(data-localise="__MSG_exceptions__") @@ -117,7 +123,7 @@ section#general_page.option-block div div - img(src="../../../assets/images/imgur-icon.png") + img(src="../../../assets/images/imgur.png") x(data-localise="__MSG_imgur__") Imgur input#imgur(type="checkbox") @@ -190,7 +196,7 @@ section#general_page.option-block div div img(src="../../../assets/images/lbry-icon.png") - x(data-localise="__MSG_lbry__") LBRY/Odysee + x(data-localise="__MSG_lbry__") LBRY input#lbry(type="checkbox") div diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 7493ecbe..25f70f48 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -28,7 +28,7 @@

TikTok

-
+ @@ -122,7 +122,7 @@

TikTok

-
+ diff --git a/src/pages/popup/popup.pug b/src/pages/popup/popup.pug index cd4d3713..7da687cc 100644 --- a/src/pages/popup/popup.pug +++ b/src/pages/popup/popup.pug @@ -33,7 +33,7 @@ mixin services .imgur.some-block a.title(href="https://imgur.com") - img(src="../../assets/images/imgur-icon.png") + img(src="../../assets/images/imgur.png") h4(data-localise="__MSG_imgur__") Imgur input.disable-imgur(type="checkbox") -- cgit 1.4.1 From 40e07fbc333354088d72c113ef0d8f1e58234aab Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Mon, 1 Aug 2022 14:28:15 +0100 Subject: http status --- README.md | 2 +- package.json | 5 +++-- src/assets/javascripts/utils.js | 11 +++++++---- src/instances/get_instances.py | 19 ++++++++++++++++++- src/pages/options/widgets/general.js | 11 +++++++++++ src/pages/widgets/links.pug | 6 +++--- 6 files changed, 43 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3bbf2b3e..a9e68391 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Quora => [Quetre](https://github.com/zyachel/quetre)\ IMDb => [Libremdb](https://github.com/zyachel/libremdb)\ PeerTube => [SimpleerTube](https://git.sr.ht/~metalune/simpleweb_peertube)\ LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian), [LBRY Desktop](https://lbry.com/get)\ -Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [Librex](https://github.com/hnhx/librex/)\ +Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [LibreX](https://github.com/hnhx/librex/)\ Translate => [SimplyTranslate](https://git.sr.ht/~metalune/simplytranslate_web), [LingvaTranslate](https://github.com/TheDavidDelta/lingva-translate)\ Maps => [OpenStreetMap](https://www.openstreetmap.org/), [FacilMap](https://github.com/FacilMap/facilmap)\ Send Files => [Send](https://gitlab.com/timvisee/send) diff --git a/package.json b/package.json index e6214c85..50872aac 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,13 @@ "bugs": { "url": "https://github.com/LibRedirect/LibRedirect/issues" }, - "homepage": "https://github.com/LibRedirect/LibRedirect", + "homepage": "https://libredirect.github.io", "devDependencies": { "prettier": "2.7.1", "web-ext": "^6.7.0" }, "dependencies": { - "buffer": "^6.0.3" + "buffer": "^6.0.3", + "ejs": "^3.1.8" } } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 9a7d37b3..32167bc6 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -25,13 +25,15 @@ function getRandomInstance(instances) { let cloudflareBlackList = [] let authenticateBlackList = [] -async function initcloudflareBlackList() { +let offlineBlacklist = [] +async function initBlackList() { return new Promise(resolve => { fetch("/instances/blacklist.json") .then(response => response.text()) .then(data => { cloudflareBlackList = JSON.parse(data).cloudflare authenticateBlackList = JSON.parse(data).authenticate + offlineBlacklist = JSON.parse(data).offlineBlacklist resolve() }) }) @@ -53,7 +55,7 @@ function updateInstances() { return } } - await initcloudflareBlackList() + await initBlackList() const instances = JSON.parse(http.responseText) youtubeHelper.setRedirects({ @@ -114,7 +116,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { let nameCustomInstances = [] let nameCheckListElement = nameProtocolElement.getElementsByClassName("checklist")[0] - await initcloudflareBlackList() + await initBlackList() let nameDefaultRedirects @@ -162,6 +164,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { ...redirects[name][protocol].map(x => { const cloudflare = cloudflareBlackList.includes(x) ? ' cloudflare' : "" const authenticate = authenticateBlackList.includes(x) ? ' authenticate' : "" + const offline = offlineBlacklist.includes(x) ? ' offline' : "" let ms = instancesLatency[x] let latencyColor = ms <= 1000 ? "green" : ms <= 2000 ? "orange" : "red" @@ -172,7 +175,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { const latency = x in instancesLatency ? '' + latencyLimit + "" : "" - let warnings = [cloudflare, authenticate, latency].join(" ") + let warnings = [cloudflare, authenticate, offline, latency].join(" ") return `
${x}${warnings} diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 0d0e8c78..07adbceb 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -89,6 +89,19 @@ def is_authenticate(url): return False return False +def is_offline(url): + try: + r = requests.get(url, timeout=5) + if r.status_code != 200: + print(url + ' is ' + Fore.RED + 'offline' + Style.RESET_ALL) + print("Status code") + print(r.status_code) + return True + else: + return False + except: + return False + def invidious(): r = requests.get('https://api.invidious.io/instances.json') @@ -635,6 +648,7 @@ mightyList = filterLastSlash(mightyList) cloudflare = [] authenticate = [] +offline = [] for k1, v1 in mightyList.items(): if type(mightyList[k1]) is dict: for k2, v2 in mightyList[k1].items(): @@ -647,12 +661,15 @@ for k1, v1 in mightyList.items(): cloudflare.append(instance) if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_authenticate(instance): authenticate.append(instance) + if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_offline(instance): + offline.append(instance) peertube() blacklist = { 'cloudflare': cloudflare, - 'authenticate': authenticate + 'authenticate': authenticate, + 'offline': offline } # Writing to file diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 5407159d..56439a95 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -156,6 +156,15 @@ protocolFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ protocolFallback: event.target.checked }) }) +let latencyOutput = document.getElementById("latency-output") +let latencyInput = document.getElementById("latency-input") +latencyInput.addEventListener("change", event => { + browser.storage.local.set({ latencyThreshold: event.target.value}) +}) +latencyInput.addEventListener("input", event => { + latencyOutput.value = event.target.value +}) + let nameCustomInstanceInput = document.getElementById("exceptions-custom-instance") let instanceTypeElement = document.getElementById("exceptions-custom-instance-type") let instanceType = "url" @@ -181,6 +190,7 @@ browser.storage.local.get( "exceptions", "protocol", "protocolFallback", + "latencyThreshold", // 'firstPartyIsolate' ], r => { @@ -188,6 +198,7 @@ browser.storage.local.get( themeElement.value = r.theme protocolElement.value = r.protocol protocolFallbackCheckbox.checked = r.protocolFallback + latencyOutput.value = r.latencyThreshold // firstPartyIsolate.checked = r.firstPartyIsolate; let protocolFallbackElement = document.getElementById("protocol-fallback") diff --git a/src/pages/widgets/links.pug b/src/pages/widgets/links.pug index cac2ecb3..c7f8e0a6 100644 --- a/src/pages/widgets/links.pug +++ b/src/pages/widgets/links.pug @@ -31,7 +31,7 @@ mixin links(service) a(href="#reddit" data-localise="__MSG_reddit__") Reddit .title - img(src="../../../assets/images/imgur-icon.png") + img(src="../../../assets/images/imgur.png") a(href="#imgur" data-localise="__MSG_imgur__") Imgur .title @@ -60,7 +60,7 @@ mixin links(service) .title img(src="../../../assets/images/lbry-icon.png") - a(href="#lbry" data-localise="__MSG_lbry__") LBRY/Odysee + a(href="#lbry" data-localise="__MSG_lbry__") LBRY .title +search @@ -80,4 +80,4 @@ mixin links(service) .title +about - a(href="#about" data-localise="__MSG_about") About \ No newline at end of file + a(href="#about" data-localise="__MSG_about") About -- cgit 1.4.1 From dd07804a31ca11e9b951c31d9d2b3535817bbac3 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 1 Aug 2022 22:39:10 +0000 Subject: update instances --- src/instances/data.json | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/instances/data.json b/src/instances/data.json index 0b95bda7..822d8c92 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -3,7 +3,6 @@ "normal": [ "https://yewtu.be", "https://vid.puffyan.us", - "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", @@ -18,10 +17,11 @@ "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://invidious.weblibre.org", "https://youtube.076.ne.jp", - "https://invidious.namazso.eu", - "https://invidious.esmailelbob.xyz" + "https://invidious.weblibre.org", + "https://invidious.snopyta.org", + "https://invidious.esmailelbob.xyz", + "https://invidious.namazso.eu" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -49,8 +49,6 @@ "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", - "https://piped.mint.lgbt", - "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], @@ -485,7 +483,6 @@ "https://searx.bissisoft.com", "https://searx.divided-by-zero.eu", "https://searx.dresden.network", - "https://searx.ebnar.xyz", "https://searx.fossencdi.org", "https://searx.gnu.style", "https://searx.mastodontech.de", @@ -520,8 +517,7 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" ], "i2p": [ "http://ransack.i2p", @@ -543,6 +539,7 @@ "https://s.frlt.one", "https://s.zhaocloud.net", "https://saber.tk", + "https://search.0relay.com", "https://search.affusio.com", "https://search.ashs.club", "https://search.bingowaves.xyz", @@ -565,6 +562,7 @@ "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", + "https://searx.ebnar.xyz", "https://searx.ericaftereric.top", "https://searx.esmailelbob.xyz", "https://searx.fi", @@ -606,6 +604,7 @@ "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", + "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" ], @@ -1020,7 +1019,6 @@ "https://videos.yeswiki.net", "https://tube.lrk.sh", "https://peertube.autogestioncitoyenne.org", - "https://stream.dynacloud.ynh.fr", "https://video.r3s.nrw", "https://peertube.semweb.pro", "https://poast.tv", -- cgit 1.4.1 From 498878639f71a665b9d6c388c267cdc437213c93 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 10:46:42 +0100 Subject: Begin work on instagram unify settings --- src/assets/javascripts/instagram.js | 54 +++++++++++++++++++++ src/assets/javascripts/utils.js | 97 +++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 45a27cb2..1690c84a 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -76,6 +76,58 @@ function init() { init() browser.storage.onChanged.addListener(init) +function initBibliogramPreferences(test, from) { + return new Promise(async resolve => { + await init() + const protocolHost = utils.protocolHost(from) + if ( + ![ + ...bibliogramNormalRedirectsChecks, + ...bibliogramTorRedirectsChecks, + ...bibliogramNormalCustomRedirects, + ...bibliogramTorCustomRedirects, + ...bibliogramI2pCustomRedirects, + ...bibliogramLokiCustomRedirects, + ].includes(protocolHost) + ) { + resolve() + return + } + + if (!test) { + let checkedInstances = [] + if (protocol == "loki") checkedInstances = [...bibliogramLokiCustomRedirects] + else if (protocol == "i2p") checkedInstances = [...bibliogramI2pCustomRedirects] + else if (protocol == "tor") checkedInstances = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects] + if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { + checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] + } + utils.getPreferencesFromToken("bibliogram", from, checkedInstances, "settings", "/settings.json") + utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") + } + resolve(true) + }) +} + +function setBibliogramPreferences() { + return new Promise(async resolve => { + await init() + if (disableInstagram || protocol === undefined) { + resolve() + return + } + let checkedInstances = [] + if (protocol == "loki") checkedInstances = [...bibliogramLokiCustomRedirects] + else if (protocol == "i2p") checkedInstances = [...bibliogramI2pCustomRedirects] + else if (protocol == "tor") checkedInstances = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects] + if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { + checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] + } + utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") + resolve() + }) +} + function all() { return [ ...bibliogramNormalRedirectsChecks, @@ -201,6 +253,8 @@ function initDefaults() { export default { setRedirects, + initBibliogramPreferences, + setBibliogramPreferences, reverse, redirect, initDefaults, diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 32167bc6..8ef25dc0 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -365,6 +365,100 @@ function getCookiesFromStorage(frontend, urls, name) { }) } +function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { + return new Promise(resolve => { + browser.storage.local.get("firstPartyIsolate", r => { + let query + if (!r.firstPartyIsolate) query = { url: protocolHost(targetUrl), name: name } + else + query = { + url: protocolHost(targetUrl), + name: name, + firstPartyDomain: null, + } + browser.cookies.getAll(query, async cookies => { + for (const cookie of cookies) + if (cookie.name == name) { + const setQuery = r.firstPartyIsolate + ? { + url: targetUrl, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(targetUrl).hostname, + } + : { + url: targetUrl, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } + console.log(toString(targetUrl)) + const http = new XMLHttpRequest(); + http.open("GET", targetUrl + endpoint) + http.setRequestHeader("Cookie", name + "=" + cookie.value) + http.send(null) + const preferences = http.responseText + //console.log(preferences) + + + browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: preferences }, () => resolve())) + break + } + resolve() + }) + }) + }) +} + + +function setPreferencesFromToken(frontend, urls, name) { + let key = `${frontend}_${name}` + let formdata = "" + browser.storage.local.get(key, r => { + //console.log(r[key]) + const preferences = JSON.parse(r[key]) + if (preferences === undefined) return + for (const prefName of names(preferences)) { + if (formdata != "") { + formdata += "&" + } + formdata += prefName + "=" + preferences[prefName] + } + for (const url of urls) { + + const http = new XMLHttpRequest(); + http.open("POST", url + "/settings") + http.send(formdata) + + + + + + /* + let query = r.firstPartyIsolate + ? { + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: null, + firstPartyDomain: new URL(url).hostname, + } + : { + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } + browser.cookies.set(query) + */ + } + }) +} + function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { @@ -434,6 +528,7 @@ function unify(test) { if (!result) result = await wikipediaHelper.initWikilessCookies(test, url) if (!result) result = await translateHelper.copyPasteSimplyTranslateCookies(test, url) if (!result) result = await translateHelper.copyPasteLingvaLocalStorage(test, url) + if (!result) result = await instagramHelper.initBibliogramPreferences(test, url) resolve(result) } @@ -508,6 +603,8 @@ export default { latency, copyCookie, getCookiesFromStorage, + getPreferencesFromToken, + setPreferencesFromToken, switchInstance, copyRaw, unify, -- cgit 1.4.1 From 790d4632fbc994490f73330f6952eb66b7c04ce0 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 2 Aug 2022 18:09:24 +0300 Subject: Some tweaks on bibliogram settings --- src/assets/javascripts/instagram.js | 23 +----- src/assets/javascripts/utils.js | 160 ++++++++++-------------------------- src/instances/blacklist.json | 37 +++++++-- src/instances/data.json | 146 ++++++++++++++++++++++---------- 4 files changed, 178 insertions(+), 188 deletions(-) diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 1690c84a..00042074 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -102,32 +102,12 @@ function initBibliogramPreferences(test, from) { if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] } - utils.getPreferencesFromToken("bibliogram", from, checkedInstances, "settings", "/settings.json") - utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") + await utils.getPreferencesFromToken("bibliogram", from, checkedInstances, "settings", "settings.json") } resolve(true) }) } -function setBibliogramPreferences() { - return new Promise(async resolve => { - await init() - if (disableInstagram || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...bibliogramLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...bibliogramI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] - } - utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") - resolve() - }) -} - function all() { return [ ...bibliogramNormalRedirectsChecks, @@ -254,7 +234,6 @@ function initDefaults() { export default { setRedirects, initBibliogramPreferences, - setBibliogramPreferences, reverse, redirect, initDefaults, diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 8ef25dc0..98dbe3da 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -315,19 +315,19 @@ function copyCookie(frontend, targetUrl, urls, name) { for (const url of urls) { const setQuery = r.firstPartyIsolate ? { - url: url, - name: name, - value: cookie.value, - secure: true, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())) } break @@ -346,20 +346,20 @@ function getCookiesFromStorage(frontend, urls, name) { for (const url of urls) { let query = r.firstPartyIsolate ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: null, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(query) } }) @@ -368,97 +368,26 @@ function getCookiesFromStorage(frontend, urls, name) { function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { - let query - if (!r.firstPartyIsolate) query = { url: protocolHost(targetUrl), name: name } - else - query = { - url: protocolHost(targetUrl), - name: name, - firstPartyDomain: null, - } - browser.cookies.getAll(query, async cookies => { - for (const cookie of cookies) - if (cookie.name == name) { - const setQuery = r.firstPartyIsolate - ? { - url: targetUrl, - name: name, - value: cookie.value, - secure: true, - firstPartyDomain: new URL(targetUrl).hostname, - } - : { - url: targetUrl, - name: name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } - console.log(toString(targetUrl)) - const http = new XMLHttpRequest(); - http.open("GET", targetUrl + endpoint) - http.setRequestHeader("Cookie", name + "=" + cookie.value) - http.send(null) - const preferences = http.responseText - //console.log(preferences) - - - browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: preferences }, () => resolve())) - break - } - resolve() - }) + const http = new XMLHttpRequest(); + const url = `${targetUrl}${endpoint}` + http.open("GET", url, false) + http.setRequestHeader("Cookie", `${name}=${cookie.value}`) + http.send(null) + const preferences = JSON.parse(http.responseText) + let formdata = new FormData(); + for (var key in preferences) formdata.append(key, preferences[key]); + for (const url of urls) { + const http = new XMLHttpRequest(); + http.open("POST", `${url}/settings/stay`, false) + http.send(null) + } + resolve() + return }) }) } -function setPreferencesFromToken(frontend, urls, name) { - let key = `${frontend}_${name}` - let formdata = "" - browser.storage.local.get(key, r => { - //console.log(r[key]) - const preferences = JSON.parse(r[key]) - if (preferences === undefined) return - for (const prefName of names(preferences)) { - if (formdata != "") { - formdata += "&" - } - formdata += prefName + "=" + preferences[prefName] - } - for (const url of urls) { - - const http = new XMLHttpRequest(); - http.open("POST", url + "/settings") - http.send(formdata) - - - - - - /* - let query = r.firstPartyIsolate - ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } - : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } - browser.cookies.set(query) - */ - } - }) -} - function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { @@ -575,18 +504,18 @@ function switchInstance(test) { } function latency(name, frontend, document, location) { - let latencyElement = document.getElementById(`latency-${frontend}`) - let latencyLabel = document.getElementById(`latency-${frontend}-label`) + let latencyElement = document.getElementById(`latency - ${frontend} `) + let latencyLabel = document.getElementById(`latency - ${frontend} -label`) latencyElement.addEventListener("click", async () => { let reloadWindow = () => location.reload() latencyElement.addEventListener("click", reloadWindow) - let key = `${name}Redirects` + let key = `${name} Redirects` browser.storage.local.get(key, r => { let redirects = r[key] const oldHtml = latencyLabel.innerHTML latencyLabel.innerHTML = "..." testLatency(latencyLabel, redirects[frontend].normal).then(r => { - browser.storage.local.set({ [`${frontend}Latency`]: r }) + browser.storage.local.set({ [`${frontend} Latency`]: r }) latencyLabel.innerHTML = oldHtml processDefaultCustomInstances(name, frontend, "normal", document) latencyElement.removeEventListener("click", reloadWindow) @@ -604,7 +533,6 @@ export default { copyCookie, getCookiesFromStorage, getPreferencesFromToken, - setPreferencesFromToken, switchInstance, copyRaw, unify, diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 54b7fe0b..221058ee 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -6,14 +6,12 @@ "https://piped.moomoo.me", "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://piped.shimul.me", + "https://jp-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", - "https://nitter.moomoo.me", - "https://nitter.it", "https://notabird.site", "https://fuckthesacklers.network", "https://nitter.winscloud.net", @@ -26,7 +24,6 @@ "https://bib.actionsack.com", "https://libreddit.domain.glass", "https://r.nf", - "https://libreddit.flux.industries", "https://lr.oversold.host", "https://libreddit.hu", "https://lr.stilic.ml", @@ -44,6 +41,8 @@ "https://teddit.garudalinux.org", "https://tedd.it", "https://wiki.604kph.xyz", + "https://lingva.garudalinux.org", + "https://translate.dr460nf1r3.org", "https://searx.org", "https://searx.run", "https://search.albony.xyz", @@ -51,9 +50,35 @@ "https://search.dr460nf1r3.org", "https://search.wef.lol", "https://i.actionsack.com", - "https://rimgo.encrypted-data.xyz" + "https://rimgo.encrypted-data.xyz", + "https://beatbump.ml" ], "authenticate": [ - "https://nitter.nixnet.services" + "https://nitter:nitter@nitter.nixnet.services" + ], + "offline": [ + "https://invidious.snopyta.org", + "https://tok.habedieeh.re", + "https://n.hyperborea.cloud", + "https://nitter.spaceint.fr", + "https://bibliogram.snopyta.org", + "https://libreddit.autarkic.org", + "https://libreddit.notyourcomputer.net", + "https://anon.sx", + "https://jsearch.pw", + "https://searx.gnu.style", + "https://searx.semipvt.com", + "https://searx.vanwa.tech", + "https://etsi.me", + "https://s.zhaocloud.net", + "https://search.vidhukant.xyz", + "https://searx.ericaftereric.top", + "https://searx.fmac.xyz", + "https://searxng.au/searx", + "https://www.webrats.xyz", + "https://search.albony.xyz", + "https://whoogle.esmailelbob.xyz", + "https://beatbump.ml", + "https://stube.tokhmi.xyz" ] } \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index b74d0622..c5334a47 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -3,7 +3,6 @@ "normal": [ "https://yewtu.be", "https://vid.puffyan.us", - "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", @@ -13,13 +12,14 @@ "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", "https://inv.bp.projectsegfau.lt", - "https://invidious.projectsegfau.lt", "https://inv.vern.cc", "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://invidious.weblibre.org", "https://youtube.076.ne.jp", + "https://invidious.weblibre.org", + "https://invidious.snopyta.org", + "https://invidious.projectsegfau.lt", "https://invidious.esmailelbob.xyz", "https://invidious.namazso.eu" ], @@ -45,19 +45,15 @@ "https://il.ax", "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://piped.shimul.me", + "https://jp-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", - "https://piped.mint.lgbt", - "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], - "tor": [ - "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" - ], + "tor": [], "i2p": [], "loki": [] }, @@ -72,6 +68,17 @@ "i2p": [], "loki": [] }, + "cloudtube": { + "normal": [ + "https://tube.cadence.moe", + "https://yt.beparanoid.de" + ], + "tor": [ + "http://yt.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion" + ], + "i2p": [], + "loki": [] + }, "proxiTok": { "normal": [ "https://proxitok.herokuapp.com", @@ -112,7 +119,7 @@ "https://nitter.net", "https://nitter.42l.fr", "https://nitter.pussthecat.org", - "https://nitter.nixnet.services", + "https://nitter:nitter@nitter.nixnet.services", "https://nitter.fdn.fr", "https://nitter.1d4.us", "https://nitter.kavin.rocks", @@ -180,12 +187,8 @@ "https://nitter.slipfox.xyz" ], "tor": [ - "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", - "http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion", "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", "http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion", - "http://nitter.v6vgyqpa7yefkorazmg5d5fimstmvm2vtbirt6676mt7qmllrcnwycqd.onion", - "http://i23nv6w3juvzlw32xzoxcqzktegd4i4fu3nmnc2ewv4ggiu4ledwklad.onion", "http://26oq3gioiwcmfojub37nz5gzbkdiqp7fue5kvye7d4txv4ny6fb4wwid.onion", "http://vfaomgh4jxphpbdfizkm5gbtjahmei234giqj4facbwhrfjtcldauqad.onion", "http://iwgu3cv7ywf3gssed5iqtavmrlszgsxazkmwwnt4h2kdait75thdyrqd.onion", @@ -206,8 +209,14 @@ "http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion", "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion" ], - "i2p": [], - "loki": [] + "i2p": [ + "http://axd6uavsstsrvstva4mzlzh4ct76rc6zdug3nxdgeitrzczhzf4q.b32.i2p", + "http://u6ikd6zndl3c4dsdq4mmujpntgeevdk5qzkfb57r4tnfeccrn2qa.b32.i2p", + "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p" + ], + "loki": [ + "http://nitter.priv.loki" + ] }, "bibliogram": { "normal": [ @@ -370,6 +379,7 @@ "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion" ], "i2p": [ + "http://wikiless.i2p", "http://hflqp2ejxygpj6cdwo3ogfieqmxw3b56w7dblt7bor2ltwk6kcfa.b32.i2p", "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p" ], @@ -381,7 +391,8 @@ "https://scribe.nixnet.services", "https://scribe.citizen4.eu", "https://scribe.bus-hit.me", - "https://scribe.froth.zone" + "https://scribe.froth.zone", + "https://scribe.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -452,7 +463,10 @@ "https://lingva.pussthecat.org", "https://translate.plausibility.cloud", "https://lingva.lunar.icu", - "https://lingva.opnxng.com" + "https://lingva.opnxng.com", + "https://translate.projectsegfau.lt", + "https://lingva.garudalinux.org", + "https://translate.dr460nf1r3.org" ], "tor": [], "i2p": [], @@ -478,8 +492,6 @@ "https://searx.netzspielplatz.de", "https://searx.nixnet.services", "https://searx.org", - "https://searx.priv.pw", - "https://searx.pwoss.org", "https://searx.rasp.fr", "https://searx.ru", "https://searx.run", @@ -489,6 +501,7 @@ "https://searx.tuxcloud.net", "https://searx.tyil.nl", "https://searx.vanwa.tech", + "https://searx.vimproved.me", "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", @@ -506,7 +519,8 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], "i2p": [ "http://ransack.i2p", @@ -519,7 +533,6 @@ "https://darmarit.org/searx", "https://de.xcxc.ml", "https://etsi.me", - "https://icanfindit.online", "https://jackgoss.xyz", "https://northboot.xyz", "https://opnxng.com", @@ -529,6 +542,7 @@ "https://s.frlt.one", "https://s.zhaocloud.net", "https://saber.tk", + "https://search.0relay.com", "https://search.affusio.com", "https://search.ashs.club", "https://search.bingowaves.xyz", @@ -561,33 +575,34 @@ "https://searx.mistli.net", "https://searx.namejeff.xyz", "https://searx.orion-hub.fr", + "https://searx.priv.pw", "https://searx.prvcy.eu", "https://searx.rimkus.it", "https://searx.sethforprivacy.com", "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", - "https://searx.vimproved.me", - "https://searx.youshitsune.me", "https://searx.zcyph.cc", "https://searxng.au/searx", "https://searxng.tordenskjold.de", "https://searxng.zackptg5.com", "https://serx.ml", + "https://sh0.it", "https://srx.cosmohub.io", "https://swag.pw", "https://www.gruble.de", "https://www.webrats.xyz", - "https://xcxc.ml" + "https://xcxc.ml", + "https://xo.wtf" ], "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", @@ -637,6 +652,7 @@ "normal": [ "https://i.bcow.xyz", "https://rimgo.pussthecat.org", + "https://rimgo.totaldarkness.net", "https://rimgo.bus-hit.me", "https://rimgo.esmailelbob.xyz", "https://rimgo.lunar.icu", @@ -662,16 +678,65 @@ "https://librarian.pussthecat.org", "https://lbry.mutahar.rocks", "https://librarian.esmailelbob.xyz", - "https://lbry.vern.cc" + "https://lbry.vern.cc", + "https://lbry.slipfox.xyz" ], "tor": [ "http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion" + ], + "i2p": [], + "loki": [] + }, + "neuters": { + "normal": [ + "https://neuters.de" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "beatbump": { + "normal": [ + "https://beatbump.ml" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "hyperpipe": { + "normal": [ + "https://hyperpipe.surge.sh", + "https://hyperpipe.esmailelbob.xyz" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "facil": { + "normal": [ + "https://facilmap.org" ], + "tor": [], + "i2p": [], + "loki": [] + }, + "simpleertube": { + "normal": [ + "https://tube.simple-web.org", + "https://simpleertube.esmailelbob.xyz", + "https://stube.tokhmi.xyz" + ], + "tor": [], "i2p": [], "loki": [] }, "peertube": [ + "https://tube.nogafa.org", + "https://www.neptube.io", + "https://tube.ghk-academy.info", + "https://pcbu.nl", "https://soberania.tv", "https://pire.artisanlogiciel.net", "https://trutube.xyz", @@ -728,7 +793,6 @@ "https://video.occm.cc", "https://peertube.viviers-fibre.net", "https://tube-action-educative.apps.education.fr", - "https://themadlads.live", "https://jahve.pl", "https://videos.yesil.club", "https://peertube.adjutor.xyz", @@ -787,7 +851,6 @@ "https://videos.neongarden.life", "https://video.vaku.org.ua", "https://videos.trom.lt", - "https://videod.fr", "https://vid.mkp.ca", "https://jupiter.tube", "https://tuvideo.encanarias.info", @@ -795,7 +858,6 @@ "https://peertube.chaunchy.com", "https://tube.vrpnet.org", "https://video.tii.space", - "https://peertube.familleboisteau.fr", "https://peertube.inubo.ch", "https://nightshift.minnix.dev", "https://tube.friloux.me", @@ -826,7 +888,6 @@ "https://video.niboe.info", "https://peertuibe.fedsinfo.nohost.me", "https://s9.gegenstimme.tv", - "https://pocketnetpeertube1.nohost.me", "https://videos.alamaisondulibre.org", "https://videos.tormentasolar.win", "https://tube.nestor.coop", @@ -850,7 +911,6 @@ "https://tube.rooty.fr", "https://tube.dnet.one", "https://peertube.io", - "https://peertube.echelon4.space", "https://www.kotikoff.net", "https://peertube.nz", "https://videos.grafo.zone", @@ -864,7 +924,6 @@ "https://krdtube.org", "https://peertube.elforcer.ru", "https://tubocatodico.bida.im", - "https://linhtran.eu", "https://torstenwitte.peertube-host.de", "https://peertube.hackerfraternity.org", "https://openmedia.edunova.it", @@ -931,7 +990,6 @@ "https://videos.slownewsdayshow.com", "https://videos.sarcasmstardust.com", "https://videos.factsonthegroundshow.com", - "https://video.regenpfeifer.net", "https://video.pe6.eu", "https://tv.santic-zombie.ru", "https://tube.sleeping.town", @@ -943,7 +1001,6 @@ "https://videos.ritimo.org", "https://videos.ephphatha.church", "https://video.cerclearistote.com", - "https://computerstuff.mooo.com", "https://video.greenmycity.eu", "https://przej.me", "https://pt.mezzo.moe", @@ -963,7 +1020,6 @@ "https://videos.yeswiki.net", "https://tube.lrk.sh", "https://peertube.autogestioncitoyenne.org", - "https://stream.dynacloud.ynh.fr", "https://video.r3s.nrw", "https://peertube.semweb.pro", "https://poast.tv", @@ -1026,7 +1082,6 @@ "https://peertube.home.x0r.fr", "https://peertube.marud.fr", "https://freetubehub.live", - "https://peertube.librelabucm.org", "https://mtube.mooo.com", "https://skeptube.fr", "https://tube.villejuif.fr", @@ -1044,7 +1099,6 @@ "https://tube.rfc1149.net", "https://tube.radiomercure.fr", "https://peertube.1984.cz", - "https://tube.sp4ke.com", "https://pt.nix.uno", "https://videos.openmandriva.org", "https://video.vanderwarker.photos", @@ -1183,7 +1237,6 @@ "https://tube.okcinfo.news", "https://www.rocaguinarda.tv", "https://videos.wirtube.de", - "https://tube.tinfoil-hat.net", "https://livegram.net", "https://video.ustim.ru", "https://merci-la-police.fr", @@ -1381,9 +1434,7 @@ "https://video.taboulisme.com", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", - "https://veezee.tube", "https://peertube.nicolastissot.fr", - "https://s2.veezee.tube", "https://tubes.jodh.us", "https://tube.lucie-philou.com", "https://video.odayacres.farm", @@ -1517,7 +1568,6 @@ "https://peertube.davigge.com", "https://vod.ksite.de", "https://tube.grin.hu", - "https://media.inno3.cricket", "https://tube.cryptography.dog", "https://peertube.zergy.net", "https://vid.ncrypt.at", @@ -1716,6 +1766,14 @@ "https://video.passageenseine.fr", "https://peertube.touhoppai.moe", "https://share.tube", - "https://peertube.heraut.eu" + "https://peertube.heraut.eu", + "https://peertube.gegeweb.eu", + "https://framatube.org", + "https://tube.conferences-gesticulees.net", + "https://peertube.datagueule.tv", + "https://video.lqdn.fr", + "https://peertube3.cpy.re", + "https://peertube2.cpy.re", + "https://peertube.cpy.re" ] } \ No newline at end of file -- cgit 1.4.1 From ec846f238854e415c07e5f6db2dae7668abb7dae Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 2 Aug 2022 18:16:17 +0300 Subject: Prettier format --- src/assets/javascripts/utils.js | 59 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 98dbe3da..f070deca 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -315,19 +315,19 @@ function copyCookie(frontend, targetUrl, urls, name) { for (const url of urls) { const setQuery = r.firstPartyIsolate ? { - url: url, - name: name, - value: cookie.value, - secure: true, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())) } break @@ -346,20 +346,20 @@ function getCookiesFromStorage(frontend, urls, name) { for (const url of urls) { let query = r.firstPartyIsolate ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: null, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(query) } }) @@ -368,16 +368,16 @@ function getCookiesFromStorage(frontend, urls, name) { function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { - const http = new XMLHttpRequest(); + const http = new XMLHttpRequest() const url = `${targetUrl}${endpoint}` http.open("GET", url, false) http.setRequestHeader("Cookie", `${name}=${cookie.value}`) http.send(null) const preferences = JSON.parse(http.responseText) - let formdata = new FormData(); - for (var key in preferences) formdata.append(key, preferences[key]); + let formdata = new FormData() + for (var key in preferences) formdata.append(key, preferences[key]) for (const url of urls) { - const http = new XMLHttpRequest(); + const http = new XMLHttpRequest() http.open("POST", `${url}/settings/stay`, false) http.send(null) } @@ -387,7 +387,6 @@ function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { }) } - function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { -- cgit 1.4.1 From 7eb2bf9a22faa58a3f226ba8d670b976952f5a04 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 2 Aug 2022 19:50:40 +0300 Subject: Unify won't save in storage anymore. Fixed Piped Unify --- src/assets/javascripts/reddit.js | 62 ---------------- src/assets/javascripts/search.js | 101 -------------------------- src/assets/javascripts/tiktok.js | 24 ------ src/assets/javascripts/translate/translate.js | 51 ------------- src/assets/javascripts/twitter.js | 38 ---------- src/assets/javascripts/utils.js | 44 ++--------- src/assets/javascripts/wikipedia.js | 23 ------ src/assets/javascripts/youtube/youtube.js | 75 +------------------ src/pages/background/background.js | 11 --- src/pages/background/incognito.html | 35 --------- src/pages/background/incognito.js | 22 ------ src/pages/options/widgets/general.js | 44 +++-------- 12 files changed, 19 insertions(+), 511 deletions(-) delete mode 100644 src/pages/background/incognito.html delete mode 100644 src/pages/background/incognito.js diff --git a/src/assets/javascripts/reddit.js b/src/assets/javascripts/reddit.js index 699dcf1a..d1bf7b99 100644 --- a/src/assets/javascripts/reddit.js +++ b/src/assets/javascripts/reddit.js @@ -145,36 +145,6 @@ function initLibredditCookies(test, from) { }) } -function pasteLibredditCookies() { - return new Promise(async resolve => { - await init() - if (disableReddit || redditFrontend != "libreddit" || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...libredditLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...libredditI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects] - } - utils.getCookiesFromStorage("libreddit", checkedInstances, "theme") - utils.getCookiesFromStorage("libreddit", checkedInstances, "front_page") - utils.getCookiesFromStorage("libreddit", checkedInstances, "layout") - utils.getCookiesFromStorage("libreddit", checkedInstances, "wide") - utils.getCookiesFromStorage("libreddit", checkedInstances, "post_sort") - utils.getCookiesFromStorage("libreddit", checkedInstances, "comment_sort") - utils.getCookiesFromStorage("libreddit", checkedInstances, "show_nsfw") - utils.getCookiesFromStorage("libreddit", checkedInstances, "autoplay_videos") - utils.getCookiesFromStorage("libreddit", checkedInstances, "use_hls") - utils.getCookiesFromStorage("libreddit", checkedInstances, "hide_hls_notification") - utils.getCookiesFromStorage("libreddit", checkedInstances, "subscriptions") - utils.getCookiesFromStorage("libreddit", checkedInstances, "filters") - resolve() - }) -} - function initTedditCookies(test, from) { return new Promise(async resolve => { await init() @@ -211,36 +181,6 @@ function initTedditCookies(test, from) { }) } -function pasteTedditCookies() { - return new Promise(async resolve => { - await init() - if (disableReddit || redditFrontend != "teddit" || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...tedditLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...tedditI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects] - } - utils.getCookiesFromStorage("teddit", checkedInstances, "collapse_child_comments") - utils.getCookiesFromStorage("teddit", checkedInstances, "domain_instagram") - utils.getCookiesFromStorage("teddit", checkedInstances, "domain_twitter") - utils.getCookiesFromStorage("teddit", checkedInstances, "domain_youtube") - utils.getCookiesFromStorage("teddit", checkedInstances, "flairs") - utils.getCookiesFromStorage("teddit", checkedInstances, "highlight_controversial") - utils.getCookiesFromStorage("teddit", checkedInstances, "nsfw_enabled") - utils.getCookiesFromStorage("teddit", checkedInstances, "post_media_max_height") - utils.getCookiesFromStorage("teddit", checkedInstances, "show_upvoted_percentage") - utils.getCookiesFromStorage("teddit", checkedInstances, "show_upvotes") - utils.getCookiesFromStorage("teddit", checkedInstances, "theme") - utils.getCookiesFromStorage("teddit", checkedInstances, "videos_muted") - resolve() - }) -} - function all() { return [ ...redditRedirects.libreddit.normal, @@ -442,9 +382,7 @@ function initDefaults() { export default { setRedirects, initLibredditCookies, - pasteLibredditCookies, initTedditCookies, - pasteTedditCookies, redirect, initDefaults, diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index b076f5d0..2a5f4867 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -240,41 +240,6 @@ function initSearxCookies(test, from) { }) } -function pasteSearxCookies() { - return new Promise(async resolve => { - await init() - if (disableSearch || searchFrontend != "searx") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...searxLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...searxI2pCustomRedirects, ...searxI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...searxTorRedirectsChecks, ...searxTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects] - } - utils.getCookiesFromStorage("searx", checkedInstances, "advanced_search") - utils.getCookiesFromStorage("searx", checkedInstances, "autocomplete") - utils.getCookiesFromStorage("searx", checkedInstances, "categories") - utils.getCookiesFromStorage("searx", checkedInstances, "disabled_engines") - utils.getCookiesFromStorage("searx", checkedInstances, "disabled_plugins") - utils.getCookiesFromStorage("searx", checkedInstances, "doi_resolver") - utils.getCookiesFromStorage("searx", checkedInstances, "enabled_engines") - utils.getCookiesFromStorage("searx", checkedInstances, "enabled_plugins") - utils.getCookiesFromStorage("searx", checkedInstances, "image_proxy") - utils.getCookiesFromStorage("searx", checkedInstances, "language") - utils.getCookiesFromStorage("searx", checkedInstances, "locale") - utils.getCookiesFromStorage("searx", checkedInstances, "method") - utils.getCookiesFromStorage("searx", checkedInstances, "oscar-style") - utils.getCookiesFromStorage("searx", checkedInstances, "results_on_new_tab") - utils.getCookiesFromStorage("searx", checkedInstances, "safesearch") - utils.getCookiesFromStorage("searx", checkedInstances, "theme") - utils.getCookiesFromStorage("searx", checkedInstances, "tokens") - resolve() - }) -} - function initSearxngCookies(test, from) { return new Promise(async resolve => { await init() @@ -326,43 +291,6 @@ function initSearxngCookies(test, from) { }) } -function pasteSearxngCookies() { - return new Promise(async resolve => { - await init() - if ((disableSearch || searchFrontend != "searxng", protocol === undefined)) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...searxngLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...searxngI2pCustomRedirects, ...searxngI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects] - } - utils.getCookiesFromStorage("searxng", checkedInstances, "autocomplete") - utils.getCookiesFromStorage("searxng", checkedInstances, "categories") - utils.getCookiesFromStorage("searxng", checkedInstances, "disabled_engines") - utils.getCookiesFromStorage("searxng", checkedInstances, "disabled_plugins") - utils.getCookiesFromStorage("searxng", checkedInstances, "doi_resolver") - utils.getCookiesFromStorage("searxng", checkedInstances, "enabled_plugins") - utils.getCookiesFromStorage("searxng", checkedInstances, "enabled_engines") - utils.getCookiesFromStorage("searxng", checkedInstances, "image_proxy") - utils.getCookiesFromStorage("searxng", checkedInstances, "infinite_scroll") - utils.getCookiesFromStorage("searxng", checkedInstances, "language") - utils.getCookiesFromStorage("searxng", checkedInstances, "locale") - utils.getCookiesFromStorage("searxng", checkedInstances, "maintab") - utils.getCookiesFromStorage("searxng", checkedInstances, "method") - utils.getCookiesFromStorage("searxng", checkedInstances, "query_in_title") - utils.getCookiesFromStorage("searxng", checkedInstances, "results_on_new_tab") - utils.getCookiesFromStorage("searxng", checkedInstances, "safesearch") - utils.getCookiesFromStorage("searxng", checkedInstances, "simple_style") - utils.getCookiesFromStorage("searxng", checkedInstances, "theme") - utils.getCookiesFromStorage("searxng", checkedInstances, "tokens") - resolve() - }) -} - function initLibrexCookies(test, from) { return new Promise(async resolve => { await init() @@ -403,32 +331,6 @@ function initLibrexCookies(test, from) { }) } -function pasteLibrexCookies() { - return new Promise(async resolve => { - await init() - if ((disableSearch || searchFrontend != "librex", protocol === undefined)) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...librexLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...librexI2pCustomRedirects, ...librexI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...librexTorRedirectsChecks, ...librexTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...librexNormalRedirectsChecks, ...librexNormalCustomRedirects] - } - utils.getCookiesFromStorage("librex", checkedInstances, "bibliogram") - utils.getCookiesFromStorage("librex", checkedInstances, "disable_special") - utils.getCookiesFromStorage("librex", checkedInstances, "invidious") - utils.getCookiesFromStorage("librex", checkedInstances, "libreddit") - utils.getCookiesFromStorage("librex", checkedInstances, "nitter") - utils.getCookiesFromStorage("librex", checkedInstances, "proxitok") - utils.getCookiesFromStorage("librex", checkedInstances, "theme") - utils.getCookiesFromStorage("librex", checkedInstances, "wikiless") - resolve() - }) -} - function redirect(url, disableOverride) { if (disableSearch && !disableOverride) return if (!targets.some(rx => rx.test(url.href))) return @@ -691,11 +593,8 @@ function initDefaults() { export default { setRedirects, initSearxCookies, - pasteSearxCookies, initSearxngCookies, - pasteSearxngCookies, initLibrexCookies, - pasteLibrexCookies, redirect, initDefaults, switchInstance, diff --git a/src/assets/javascripts/tiktok.js b/src/assets/javascripts/tiktok.js index ba4a9ff1..9d2660d4 100644 --- a/src/assets/javascripts/tiktok.js +++ b/src/assets/javascripts/tiktok.js @@ -62,26 +62,6 @@ function initProxiTokCookies(test, from) { }) } -function pasteProxiTokCookies() { - return new Promise(async resolve => { - await init() - if (disableTiktok || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...proxiTokI2pCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...proxiTokLokiCustomRedirects] - else if (protocol == "tor") checkedInstances = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects] - } - utils.getCookiesFromStorage("proxitok", checkedInstances, "theme") - utils.getCookiesFromStorage("proxitok", checkedInstances, "api-legacy") - resolve() - }) -} - let disableTiktok, protocol, protocolFallback, @@ -248,13 +228,9 @@ function initDefaults() { export default { setRedirects, - redirect, reverse, switchInstance, - initProxiTokCookies, - pasteProxiTokCookies, - initDefaults, } diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 5512f7f1..893be4e2 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -160,33 +160,6 @@ function copyPasteLingvaLocalStorage(test, url, tabId) { }) } -function pasteLingvaLocalStorage() { - return new Promise(async resolve => { - await init() - if (translateDisable || translateFrontend != "lingva") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...lingvaLokiCustomRedirects] - //...lingvaLokiRedirectsChecks, - else if (protocol == "i2p") checkedInstances = [...lingvaI2pCustomRedirects] - //...lingvaI2pRedirectsChecks, - else if (protocol == "tor") checkedInstances = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects] - } - for (const to of checkedInstances) - browser.tabs.create({ url: to }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/translate/set_lingva_preferences.js", - runAt: "document_start", - }) - ) - resolve() - }) -} - function copyPasteSimplyTranslateCookies(test, from) { return new Promise(async resolve => { await init() @@ -223,28 +196,6 @@ function copyPasteSimplyTranslateCookies(test, from) { }) } -function pasteSimplyTranslateCookies() { - return new Promise(async resolve => { - await init() - if (translateDisable || translateFrontend != "simplyTranslate") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...simplyTranslateI2pCustomRedirects, ...simplyTranslateI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects] - } - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "from_lang") - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "to_lang") - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "tts_enabled") - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "use_text_fields") - resolve() - }) -} - function redirect(url, disableOverride) { if (translateDisable && !disableOverride) return if (!targets.some(rx => rx.test(url.href))) return @@ -403,9 +354,7 @@ function initDefaults() { export default { copyPasteSimplyTranslateCookies, - pasteSimplyTranslateCookies, copyPasteLingvaLocalStorage, - pasteLingvaLocalStorage, setRedirects, redirect, initDefaults, diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 1ec4d8eb..b3c33560 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -215,43 +215,6 @@ function initNitterCookies(test, from) { }) } -function pasteNitterCookies() { - return new Promise(async resolve => { - await init() - if (disableTwitter || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...nitterI2pCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...nitterLokiCustomRedirects] - else if (protocol == "tor") checkedInstances = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects] - } - utils.getCookiesFromStorage("nitter", checkedInstances, "theme") - utils.getCookiesFromStorage("nitter", checkedInstances, "infiniteScroll") - utils.getCookiesFromStorage("nitter", checkedInstances, "stickyProfile") - utils.getCookiesFromStorage("nitter", checkedInstances, "bidiSupport") - utils.getCookiesFromStorage("nitter", checkedInstances, "hideTweetStats") - utils.getCookiesFromStorage("nitter", checkedInstances, "hideBanner") - utils.getCookiesFromStorage("nitter", checkedInstances, "hidePins") - utils.getCookiesFromStorage("nitter", checkedInstances, "hideReplies") - utils.getCookiesFromStorage("nitter", checkedInstances, "squareAvatars") - utils.getCookiesFromStorage("nitter", checkedInstances, "mp4Playback") - utils.getCookiesFromStorage("nitter", checkedInstances, "hlsPlayback") - utils.getCookiesFromStorage("nitter", checkedInstances, "proxyVideos") - utils.getCookiesFromStorage("nitter", checkedInstances, "muteVideos") - utils.getCookiesFromStorage("nitter", checkedInstances, "autoplayGifs") - - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceInstagram") - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceReddit") - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceTwitter") - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceYouTube") - resolve() - }) -} - function initDefaults() { return new Promise(resolve => { fetch("/instances/data.json") @@ -299,6 +262,5 @@ export default { reverse, removeXFrameOptions, initNitterCookies, - pasteNitterCookies, initDefaults, } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index f070deca..e9a30400 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -302,7 +302,11 @@ function copyCookie(frontend, targetUrl, urls, name) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { let query - if (!r.firstPartyIsolate) query = { url: protocolHost(targetUrl), name: name } + if (!r.firstPartyIsolate) + query = { + url: protocolHost(targetUrl), + name: name, + } else query = { url: protocolHost(targetUrl), @@ -328,7 +332,7 @@ function copyCookie(frontend, targetUrl, urls, name) { secure: true, expirationDate: cookie.expirationDate, } - browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())) + browser.cookies.set(setQuery) } break } @@ -338,33 +342,6 @@ function copyCookie(frontend, targetUrl, urls, name) { }) } -function getCookiesFromStorage(frontend, urls, name) { - let key = `${frontend}_${name}` - browser.storage.local.get([key, "firstPartyIsolate"], r => { - const cookie = r[key] - if (cookie === undefined) return - for (const url of urls) { - let query = r.firstPartyIsolate - ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } - : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } - browser.cookies.set(query) - } - }) -} - function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { @@ -437,10 +414,6 @@ function unify(test) { resolve() return } - if (currTab.incognito) { - resolve() - return - } let result = await youtubeHelper.copyPasteInvidiousCookies(test, url) if (!result) result = await youtubeHelper.copyPastePipedLocalStorage(test, url, currTab.id) @@ -503,8 +476,8 @@ function switchInstance(test) { } function latency(name, frontend, document, location) { - let latencyElement = document.getElementById(`latency - ${frontend} `) - let latencyLabel = document.getElementById(`latency - ${frontend} -label`) + let latencyElement = document.getElementById(`latency-${frontend}`) + let latencyLabel = document.getElementById(`latency-${frontend}-label`) latencyElement.addEventListener("click", async () => { let reloadWindow = () => location.reload() latencyElement.addEventListener("click", reloadWindow) @@ -530,7 +503,6 @@ export default { processDefaultCustomInstances, latency, copyCookie, - getCookiesFromStorage, getPreferencesFromToken, switchInstance, copyRaw, diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index cf19b208..04191d1a 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -113,26 +113,6 @@ function initWikilessCookies(test, from) { }) } -function pasteWikilessCookies() { - return new Promise(async resolve => { - await init() - if (disableWikipedia || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...wikilessLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects] - } - utils.getCookiesFromStorage("wikiless", checkedInstances, "theme") - utils.getCookiesFromStorage("wikiless", checkedInstances, "default_lang") - resolve() - }) -} - function redirect(url, disableOverride) { if (disableWikipedia && !disableOverride) return if (!targets.test(url.href)) return @@ -252,10 +232,7 @@ function initDefaults() { export default { setRedirects, - initWikilessCookies, - pasteWikilessCookies, - redirect, initDefaults, switchInstance, diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index e8a77ff6..7e02dcd2 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -573,25 +573,6 @@ function copyPasteInvidiousCookies(test, from) { }) } -function pasteInvidiousCookies() { - return new Promise(async resolve => { - await init() - if (disableYoutube || youtubeFrontend != "invidious") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...invidiousLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...invidiousI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects] - } - utils.getCookiesFromStorage("invidious", checkedInstances, "PREFS") - resolve() - }) -} - function copyPastePipedLocalStorage(test, url, tabId) { return new Promise(async resolve => { await init() @@ -619,7 +600,7 @@ function copyPastePipedLocalStorage(test, url, tabId) { if (protocol == "loki") checkedInstances = [...pipedLokiCustomRedirects] else if (protocol == "i2p") checkedInstances = [...pipedI2pCustomRedirects] else if (protocol == "tor") checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { + if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks] } const i = checkedInstances.indexOf(protocolHost) @@ -636,31 +617,6 @@ function copyPastePipedLocalStorage(test, url, tabId) { resolve(true) }) } -function pastePipedLocalStorage() { - return new Promise(async resolve => { - await init() - if (disableYoutube || youtubeFrontend != "piped") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...pipedLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...pipedI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks] - } - for (const to of checkedInstances) { - browser.tabs.create({ url: to }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/youtube/set_piped_preferences.js", - runAt: "document_start", - }) - ) - } - resolve() - }) -} function copyPastePipedMaterialLocalStorage(test, url, tabId) { return new Promise(async resolve => { @@ -711,32 +667,6 @@ function copyPastePipedMaterialLocalStorage(test, url, tabId) { }) } -function pastePipedMaterialLocalStorage() { - return new Promise(async resolve => { - await init() - if (disableYoutube || youtubeFrontend != "pipedMaterial") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...pipedMaterialLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...pipedMaterialI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...pipedMaterialTorCustomRedirects] //...pipedMaterialTorRedirectsChecks, - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects] - } - for (const to of checkedInstances) { - browser.tabs.create({ url: to }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/youtube/set_pipedMaterial_preferences.js", - runAt: "document_start", - }) - ) - } - resolve() - }) -} - function removeXFrameOptions(e) { let isChanged = false @@ -843,11 +773,8 @@ function removeXFrameOptions(e) { export default { setRedirects, copyPastePipedLocalStorage, - pastePipedLocalStorage, copyPastePipedMaterialLocalStorage, - pastePipedMaterialLocalStorage, copyPasteInvidiousCookies, - pasteInvidiousCookies, redirect, reverse, switchInstance, diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 359a912d..a1b0c9c6 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -71,17 +71,6 @@ browser.runtime.onInstalled.addListener(details => { // } }) -youtubeHelper.pasteInvidiousCookies() -translateHelper.pasteSimplyTranslateCookies() -twitterHelper.pasteNitterCookies() -wikipediaHelper.pasteWikilessCookies() -searchHelper.pasteSearxCookies() -searchHelper.pasteSearxngCookies() -searchHelper.pasteLibrexCookies() -redditHelper.pasteLibredditCookies() -redditHelper.pasteTedditCookies() -tiktokHelper.pasteProxiTokCookies() - let BYPASSTABs = [] browser.webRequest.onBeforeRequest.addListener( details => { diff --git a/src/pages/background/incognito.html b/src/pages/background/incognito.html deleted file mode 100644 index 227d99e4..00000000 --- a/src/pages/background/incognito.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - Initializing Cookies - - - - - -
-

Initializing Cookies...

-
- - - diff --git a/src/pages/background/incognito.js b/src/pages/background/incognito.js deleted file mode 100644 index c7ed2b7d..00000000 --- a/src/pages/background/incognito.js +++ /dev/null @@ -1,22 +0,0 @@ -import youtubeHelper from "../../assets/javascripts/youtube/youtube.js" -import twitterHelper from "../../assets/javascripts/twitter.js" -import redditHelper from "../../assets/javascripts/reddit.js" -import searchHelper from "../../assets/javascripts/search.js" -import translateHelper from "../../assets/javascripts/translate/translate.js" -import wikipediaHelper from "../../assets/javascripts/wikipedia.js" -import tiktokHelper from "../../assets/javascripts/tiktok.js" - -window.browser = window.browser || window.chrome - -await youtubeHelper.pasteInvidiousCookies() -await translateHelper.pasteSimplyTranslateCookies() -await twitterHelper.pasteNitterCookies() -await wikipediaHelper.pasteWikilessCookies() -await searchHelper.pasteSearxCookies() -await searchHelper.pasteSearxngCookies() -await searchHelper.pasteLibrexCookies() -await redditHelper.pasteLibredditCookies() -await redditHelper.pasteTedditCookies() -await tiktokHelper.pasteProxiTokCookies() - -window.close() diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 56439a95..c64eb25d 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -56,31 +56,7 @@ 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 }, async () => { - await youtubeHelper.pasteInvidiousCookies() - await youtubeHelper.pastePipedLocalStorage() - await youtubeHelper.pastePipedMaterialLocalStorage() - - await translateHelper.pasteSimplyTranslateCookies() - await translateHelper.pasteLingvaLocalStorage() - - await twitterHelper.pasteNitterCookies() - - await wikipediaHelper.pasteWikilessCookies() - - await searchHelper.pasteSearxCookies() - await searchHelper.pasteSearxngCookies() - await searchHelper.pasteLibrexCookies() - - await redditHelper.pasteLibredditCookies() - await redditHelper.pasteTedditCookies() - - await tiktokHelper.pasteProxiTokCookies() - - location.reload() - }) - }) + browser.storage.local.clear(() => browser.storage.local.set({ ...data }, () => location.reload())) } else { console.log("incompatible settings") importError() @@ -156,14 +132,14 @@ protocolFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ protocolFallback: event.target.checked }) }) -let latencyOutput = document.getElementById("latency-output") -let latencyInput = document.getElementById("latency-input") -latencyInput.addEventListener("change", event => { - browser.storage.local.set({ latencyThreshold: event.target.value}) -}) -latencyInput.addEventListener("input", event => { - latencyOutput.value = event.target.value -}) +// let latencyOutput = document.getElementById("latency-output") +// let latencyInput = document.getElementById("latency-input") +// latencyInput.addEventListener("change", event => { +// browser.storage.local.set({ latencyThreshold: event.target.value }) +// }) +// latencyInput.addEventListener("input", event => { +// latencyOutput.value = event.target.value +// }) let nameCustomInstanceInput = document.getElementById("exceptions-custom-instance") let instanceTypeElement = document.getElementById("exceptions-custom-instance-type") @@ -198,7 +174,7 @@ browser.storage.local.get( themeElement.value = r.theme protocolElement.value = r.protocol protocolFallbackCheckbox.checked = r.protocolFallback - latencyOutput.value = r.latencyThreshold + // latencyOutput.value = r.latencyThreshold // firstPartyIsolate.checked = r.firstPartyIsolate; let protocolFallbackElement = document.getElementById("protocol-fallback") -- cgit 1.4.1 From 9a884ca5c0a5217543dbce6b20ff457fcd5fbaa0 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Mon, 1 Aug 2022 14:28:15 +0100 Subject: http status --- README.md | 2 +- package.json | 5 +++-- src/assets/javascripts/utils.js | 11 +++++++---- src/instances/get_instances.py | 19 ++++++++++++++++++- src/pages/options/widgets/general.js | 11 +++++++++++ src/pages/widgets/links.pug | 6 +++--- 6 files changed, 43 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3bbf2b3e..a9e68391 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Quora => [Quetre](https://github.com/zyachel/quetre)\ IMDb => [Libremdb](https://github.com/zyachel/libremdb)\ PeerTube => [SimpleerTube](https://git.sr.ht/~metalune/simpleweb_peertube)\ LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian), [LBRY Desktop](https://lbry.com/get)\ -Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [Librex](https://github.com/hnhx/librex/)\ +Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [LibreX](https://github.com/hnhx/librex/)\ Translate => [SimplyTranslate](https://git.sr.ht/~metalune/simplytranslate_web), [LingvaTranslate](https://github.com/TheDavidDelta/lingva-translate)\ Maps => [OpenStreetMap](https://www.openstreetmap.org/), [FacilMap](https://github.com/FacilMap/facilmap)\ Send Files => [Send](https://gitlab.com/timvisee/send) diff --git a/package.json b/package.json index e6214c85..50872aac 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,13 @@ "bugs": { "url": "https://github.com/LibRedirect/LibRedirect/issues" }, - "homepage": "https://github.com/LibRedirect/LibRedirect", + "homepage": "https://libredirect.github.io", "devDependencies": { "prettier": "2.7.1", "web-ext": "^6.7.0" }, "dependencies": { - "buffer": "^6.0.3" + "buffer": "^6.0.3", + "ejs": "^3.1.8" } } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 52848de7..929b5c17 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -25,13 +25,15 @@ function getRandomInstance(instances) { let cloudflareBlackList = [] let authenticateBlackList = [] -async function initcloudflareBlackList() { +let offlineBlacklist = [] +async function initBlackList() { return new Promise(resolve => { fetch("/instances/blacklist.json") .then(response => response.text()) .then(data => { cloudflareBlackList = JSON.parse(data).cloudflare authenticateBlackList = JSON.parse(data).authenticate + offlineBlacklist = JSON.parse(data).offlineBlacklist resolve() }) }) @@ -53,7 +55,7 @@ function updateInstances() { return } } - await initcloudflareBlackList() + await initBlackList() const instances = JSON.parse(http.responseText) youtubeHelper.setRedirects({ @@ -114,7 +116,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { let nameCustomInstances = [] let nameCheckListElement = nameProtocolElement.getElementsByClassName("checklist")[0] - await initcloudflareBlackList() + await initBlackList() let nameDefaultRedirects @@ -162,6 +164,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { ...redirects[name][protocol].map(x => { const cloudflare = cloudflareBlackList.includes(x) ? ' cloudflare' : "" const authenticate = authenticateBlackList.includes(x) ? ' authenticate' : "" + const offline = offlineBlacklist.includes(x) ? ' offline' : "" let ms = instancesLatency[x] let latencyColor = ms <= 1000 ? "green" : ms <= 2000 ? "orange" : "red" @@ -172,7 +175,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { const latency = x in instancesLatency ? '' + latencyLimit + "" : "" - let warnings = [cloudflare, authenticate, latency].join(" ") + let warnings = [cloudflare, authenticate, offline, latency].join(" ") return `
${x}${warnings} diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 0d0e8c78..07adbceb 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -89,6 +89,19 @@ def is_authenticate(url): return False return False +def is_offline(url): + try: + r = requests.get(url, timeout=5) + if r.status_code != 200: + print(url + ' is ' + Fore.RED + 'offline' + Style.RESET_ALL) + print("Status code") + print(r.status_code) + return True + else: + return False + except: + return False + def invidious(): r = requests.get('https://api.invidious.io/instances.json') @@ -635,6 +648,7 @@ mightyList = filterLastSlash(mightyList) cloudflare = [] authenticate = [] +offline = [] for k1, v1 in mightyList.items(): if type(mightyList[k1]) is dict: for k2, v2 in mightyList[k1].items(): @@ -647,12 +661,15 @@ for k1, v1 in mightyList.items(): cloudflare.append(instance) if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_authenticate(instance): authenticate.append(instance) + if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_offline(instance): + offline.append(instance) peertube() blacklist = { 'cloudflare': cloudflare, - 'authenticate': authenticate + 'authenticate': authenticate, + 'offline': offline } # Writing to file diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 5407159d..56439a95 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -156,6 +156,15 @@ protocolFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ protocolFallback: event.target.checked }) }) +let latencyOutput = document.getElementById("latency-output") +let latencyInput = document.getElementById("latency-input") +latencyInput.addEventListener("change", event => { + browser.storage.local.set({ latencyThreshold: event.target.value}) +}) +latencyInput.addEventListener("input", event => { + latencyOutput.value = event.target.value +}) + let nameCustomInstanceInput = document.getElementById("exceptions-custom-instance") let instanceTypeElement = document.getElementById("exceptions-custom-instance-type") let instanceType = "url" @@ -181,6 +190,7 @@ browser.storage.local.get( "exceptions", "protocol", "protocolFallback", + "latencyThreshold", // 'firstPartyIsolate' ], r => { @@ -188,6 +198,7 @@ browser.storage.local.get( themeElement.value = r.theme protocolElement.value = r.protocol protocolFallbackCheckbox.checked = r.protocolFallback + latencyOutput.value = r.latencyThreshold // firstPartyIsolate.checked = r.firstPartyIsolate; let protocolFallbackElement = document.getElementById("protocol-fallback") diff --git a/src/pages/widgets/links.pug b/src/pages/widgets/links.pug index cac2ecb3..c7f8e0a6 100644 --- a/src/pages/widgets/links.pug +++ b/src/pages/widgets/links.pug @@ -31,7 +31,7 @@ mixin links(service) a(href="#reddit" data-localise="__MSG_reddit__") Reddit .title - img(src="../../../assets/images/imgur-icon.png") + img(src="../../../assets/images/imgur.png") a(href="#imgur" data-localise="__MSG_imgur__") Imgur .title @@ -60,7 +60,7 @@ mixin links(service) .title img(src="../../../assets/images/lbry-icon.png") - a(href="#lbry" data-localise="__MSG_lbry__") LBRY/Odysee + a(href="#lbry" data-localise="__MSG_lbry__") LBRY .title +search @@ -80,4 +80,4 @@ mixin links(service) .title +about - a(href="#about" data-localise="__MSG_about") About \ No newline at end of file + a(href="#about" data-localise="__MSG_about") About -- cgit 1.4.1 From 6a1ac047915a997b7b638a94436a32f00376ead6 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 10:46:42 +0100 Subject: Begin work on instagram unify settings --- src/assets/javascripts/instagram.js | 54 +++++++++++++++++++++ src/assets/javascripts/utils.js | 97 +++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 45a27cb2..1690c84a 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -76,6 +76,58 @@ function init() { init() browser.storage.onChanged.addListener(init) +function initBibliogramPreferences(test, from) { + return new Promise(async resolve => { + await init() + const protocolHost = utils.protocolHost(from) + if ( + ![ + ...bibliogramNormalRedirectsChecks, + ...bibliogramTorRedirectsChecks, + ...bibliogramNormalCustomRedirects, + ...bibliogramTorCustomRedirects, + ...bibliogramI2pCustomRedirects, + ...bibliogramLokiCustomRedirects, + ].includes(protocolHost) + ) { + resolve() + return + } + + if (!test) { + let checkedInstances = [] + if (protocol == "loki") checkedInstances = [...bibliogramLokiCustomRedirects] + else if (protocol == "i2p") checkedInstances = [...bibliogramI2pCustomRedirects] + else if (protocol == "tor") checkedInstances = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects] + if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { + checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] + } + utils.getPreferencesFromToken("bibliogram", from, checkedInstances, "settings", "/settings.json") + utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") + } + resolve(true) + }) +} + +function setBibliogramPreferences() { + return new Promise(async resolve => { + await init() + if (disableInstagram || protocol === undefined) { + resolve() + return + } + let checkedInstances = [] + if (protocol == "loki") checkedInstances = [...bibliogramLokiCustomRedirects] + else if (protocol == "i2p") checkedInstances = [...bibliogramI2pCustomRedirects] + else if (protocol == "tor") checkedInstances = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects] + if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { + checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] + } + utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") + resolve() + }) +} + function all() { return [ ...bibliogramNormalRedirectsChecks, @@ -201,6 +253,8 @@ function initDefaults() { export default { setRedirects, + initBibliogramPreferences, + setBibliogramPreferences, reverse, redirect, initDefaults, diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 929b5c17..59beeac7 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -402,6 +402,100 @@ function getCookiesFromStorage(frontend, urls, name) { }) } +function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { + return new Promise(resolve => { + browser.storage.local.get("firstPartyIsolate", r => { + let query + if (!r.firstPartyIsolate) query = { url: protocolHost(targetUrl), name: name } + else + query = { + url: protocolHost(targetUrl), + name: name, + firstPartyDomain: null, + } + browser.cookies.getAll(query, async cookies => { + for (const cookie of cookies) + if (cookie.name == name) { + const setQuery = r.firstPartyIsolate + ? { + url: targetUrl, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(targetUrl).hostname, + } + : { + url: targetUrl, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } + console.log(toString(targetUrl)) + const http = new XMLHttpRequest(); + http.open("GET", targetUrl + endpoint) + http.setRequestHeader("Cookie", name + "=" + cookie.value) + http.send(null) + const preferences = http.responseText + //console.log(preferences) + + + browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: preferences }, () => resolve())) + break + } + resolve() + }) + }) + }) +} + + +function setPreferencesFromToken(frontend, urls, name) { + let key = `${frontend}_${name}` + let formdata = "" + browser.storage.local.get(key, r => { + //console.log(r[key]) + const preferences = JSON.parse(r[key]) + if (preferences === undefined) return + for (const prefName of names(preferences)) { + if (formdata != "") { + formdata += "&" + } + formdata += prefName + "=" + preferences[prefName] + } + for (const url of urls) { + + const http = new XMLHttpRequest(); + http.open("POST", url + "/settings") + http.send(formdata) + + + + + + /* + let query = r.firstPartyIsolate + ? { + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: null, + firstPartyDomain: new URL(url).hostname, + } + : { + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } + browser.cookies.set(query) + */ + } + }) +} + function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { @@ -471,6 +565,7 @@ function unify(test) { if (!result) result = await wikipediaHelper.initWikilessCookies(test, url) if (!result) result = await translateHelper.copyPasteSimplyTranslateCookies(test, url) if (!result) result = await translateHelper.copyPasteLingvaLocalStorage(test, url) + if (!result) result = await instagramHelper.initBibliogramPreferences(test, url) resolve(result) } @@ -545,6 +640,8 @@ export default { latency, copyCookie, getCookiesFromStorage, + getPreferencesFromToken, + setPreferencesFromToken, switchInstance, copyRaw, unify, -- cgit 1.4.1 From 8ea4d37b43b71b9ab5f81f1d95a0ad1ff1abc65c Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 2 Aug 2022 18:09:24 +0300 Subject: rebase --- src/assets/javascripts/instagram.js | 23 +----- src/assets/javascripts/utils.js | 158 ++++++++++-------------------------- src/instances/blacklist.json | 37 +++++++-- src/instances/data.json | 146 +++++++++++++++++++++++---------- 4 files changed, 177 insertions(+), 187 deletions(-) diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 1690c84a..00042074 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -102,32 +102,12 @@ function initBibliogramPreferences(test, from) { if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] } - utils.getPreferencesFromToken("bibliogram", from, checkedInstances, "settings", "/settings.json") - utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") + await utils.getPreferencesFromToken("bibliogram", from, checkedInstances, "settings", "settings.json") } resolve(true) }) } -function setBibliogramPreferences() { - return new Promise(async resolve => { - await init() - if (disableInstagram || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...bibliogramLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...bibliogramI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects] - } - utils.setPreferencesFromToken("bibliogram", checkedInstances, "settings") - resolve() - }) -} - function all() { return [ ...bibliogramNormalRedirectsChecks, @@ -254,7 +234,6 @@ function initDefaults() { export default { setRedirects, initBibliogramPreferences, - setBibliogramPreferences, reverse, redirect, initDefaults, diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 59beeac7..a6b011a3 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -352,19 +352,19 @@ function copyCookie(frontend, targetUrl, urls, name) { for (const url of urls) { const setQuery = r.firstPartyIsolate ? { - url: url, - name: name, - value: cookie.value, - secure: true, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())) } break @@ -383,20 +383,20 @@ function getCookiesFromStorage(frontend, urls, name) { for (const url of urls) { let query = r.firstPartyIsolate ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: null, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(query) } }) @@ -405,97 +405,26 @@ function getCookiesFromStorage(frontend, urls, name) { function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { - let query - if (!r.firstPartyIsolate) query = { url: protocolHost(targetUrl), name: name } - else - query = { - url: protocolHost(targetUrl), - name: name, - firstPartyDomain: null, - } - browser.cookies.getAll(query, async cookies => { - for (const cookie of cookies) - if (cookie.name == name) { - const setQuery = r.firstPartyIsolate - ? { - url: targetUrl, - name: name, - value: cookie.value, - secure: true, - firstPartyDomain: new URL(targetUrl).hostname, - } - : { - url: targetUrl, - name: name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } - console.log(toString(targetUrl)) - const http = new XMLHttpRequest(); - http.open("GET", targetUrl + endpoint) - http.setRequestHeader("Cookie", name + "=" + cookie.value) - http.send(null) - const preferences = http.responseText - //console.log(preferences) - - - browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: preferences }, () => resolve())) - break - } - resolve() - }) + const http = new XMLHttpRequest(); + const url = `${targetUrl}${endpoint}` + http.open("GET", url, false) + http.setRequestHeader("Cookie", `${name}=${cookie.value}`) + http.send(null) + const preferences = JSON.parse(http.responseText) + let formdata = new FormData(); + for (var key in preferences) formdata.append(key, preferences[key]); + for (const url of urls) { + const http = new XMLHttpRequest(); + http.open("POST", `${url}/settings/stay`, false) + http.send(null) + } + resolve() + return }) }) } -function setPreferencesFromToken(frontend, urls, name) { - let key = `${frontend}_${name}` - let formdata = "" - browser.storage.local.get(key, r => { - //console.log(r[key]) - const preferences = JSON.parse(r[key]) - if (preferences === undefined) return - for (const prefName of names(preferences)) { - if (formdata != "") { - formdata += "&" - } - formdata += prefName + "=" + preferences[prefName] - } - for (const url of urls) { - - const http = new XMLHttpRequest(); - http.open("POST", url + "/settings") - http.send(formdata) - - - - - - /* - let query = r.firstPartyIsolate - ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } - : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } - browser.cookies.set(query) - */ - } - }) -} - function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { @@ -612,12 +541,12 @@ function switchInstance(test) { } function latency(name, frontend, document, location) { - let latencyElement = document.getElementById(`latency-${frontend}`) - let latencyLabel = document.getElementById(`latency-${frontend}-label`) + let latencyElement = document.getElementById(`latency - ${frontend} `) + let latencyLabel = document.getElementById(`latency - ${frontend} -label`) latencyElement.addEventListener("click", async () => { let reloadWindow = () => location.reload() latencyElement.addEventListener("click", reloadWindow) - let key = `${name}Redirects` + let key = `${name} Redirects` browser.storage.local.get(key, r => { let redirects = r[key] const oldHtml = latencyLabel.innerHTML @@ -641,7 +570,6 @@ export default { copyCookie, getCookiesFromStorage, getPreferencesFromToken, - setPreferencesFromToken, switchInstance, copyRaw, unify, diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 54b7fe0b..221058ee 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -6,14 +6,12 @@ "https://piped.moomoo.me", "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://piped.shimul.me", + "https://jp-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", - "https://nitter.moomoo.me", - "https://nitter.it", "https://notabird.site", "https://fuckthesacklers.network", "https://nitter.winscloud.net", @@ -26,7 +24,6 @@ "https://bib.actionsack.com", "https://libreddit.domain.glass", "https://r.nf", - "https://libreddit.flux.industries", "https://lr.oversold.host", "https://libreddit.hu", "https://lr.stilic.ml", @@ -44,6 +41,8 @@ "https://teddit.garudalinux.org", "https://tedd.it", "https://wiki.604kph.xyz", + "https://lingva.garudalinux.org", + "https://translate.dr460nf1r3.org", "https://searx.org", "https://searx.run", "https://search.albony.xyz", @@ -51,9 +50,35 @@ "https://search.dr460nf1r3.org", "https://search.wef.lol", "https://i.actionsack.com", - "https://rimgo.encrypted-data.xyz" + "https://rimgo.encrypted-data.xyz", + "https://beatbump.ml" ], "authenticate": [ - "https://nitter.nixnet.services" + "https://nitter:nitter@nitter.nixnet.services" + ], + "offline": [ + "https://invidious.snopyta.org", + "https://tok.habedieeh.re", + "https://n.hyperborea.cloud", + "https://nitter.spaceint.fr", + "https://bibliogram.snopyta.org", + "https://libreddit.autarkic.org", + "https://libreddit.notyourcomputer.net", + "https://anon.sx", + "https://jsearch.pw", + "https://searx.gnu.style", + "https://searx.semipvt.com", + "https://searx.vanwa.tech", + "https://etsi.me", + "https://s.zhaocloud.net", + "https://search.vidhukant.xyz", + "https://searx.ericaftereric.top", + "https://searx.fmac.xyz", + "https://searxng.au/searx", + "https://www.webrats.xyz", + "https://search.albony.xyz", + "https://whoogle.esmailelbob.xyz", + "https://beatbump.ml", + "https://stube.tokhmi.xyz" ] } \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index b74d0622..c5334a47 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -3,7 +3,6 @@ "normal": [ "https://yewtu.be", "https://vid.puffyan.us", - "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", @@ -13,13 +12,14 @@ "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", "https://inv.bp.projectsegfau.lt", - "https://invidious.projectsegfau.lt", "https://inv.vern.cc", "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://invidious.weblibre.org", "https://youtube.076.ne.jp", + "https://invidious.weblibre.org", + "https://invidious.snopyta.org", + "https://invidious.projectsegfau.lt", "https://invidious.esmailelbob.xyz", "https://invidious.namazso.eu" ], @@ -45,19 +45,15 @@ "https://il.ax", "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://piped.shimul.me", + "https://jp-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", - "https://piped.mint.lgbt", - "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], - "tor": [ - "http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion" - ], + "tor": [], "i2p": [], "loki": [] }, @@ -72,6 +68,17 @@ "i2p": [], "loki": [] }, + "cloudtube": { + "normal": [ + "https://tube.cadence.moe", + "https://yt.beparanoid.de" + ], + "tor": [ + "http://yt.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion" + ], + "i2p": [], + "loki": [] + }, "proxiTok": { "normal": [ "https://proxitok.herokuapp.com", @@ -112,7 +119,7 @@ "https://nitter.net", "https://nitter.42l.fr", "https://nitter.pussthecat.org", - "https://nitter.nixnet.services", + "https://nitter:nitter@nitter.nixnet.services", "https://nitter.fdn.fr", "https://nitter.1d4.us", "https://nitter.kavin.rocks", @@ -180,12 +187,8 @@ "https://nitter.slipfox.xyz" ], "tor": [ - "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", - "http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion", "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", "http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion", - "http://nitter.v6vgyqpa7yefkorazmg5d5fimstmvm2vtbirt6676mt7qmllrcnwycqd.onion", - "http://i23nv6w3juvzlw32xzoxcqzktegd4i4fu3nmnc2ewv4ggiu4ledwklad.onion", "http://26oq3gioiwcmfojub37nz5gzbkdiqp7fue5kvye7d4txv4ny6fb4wwid.onion", "http://vfaomgh4jxphpbdfizkm5gbtjahmei234giqj4facbwhrfjtcldauqad.onion", "http://iwgu3cv7ywf3gssed5iqtavmrlszgsxazkmwwnt4h2kdait75thdyrqd.onion", @@ -206,8 +209,14 @@ "http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion", "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion" ], - "i2p": [], - "loki": [] + "i2p": [ + "http://axd6uavsstsrvstva4mzlzh4ct76rc6zdug3nxdgeitrzczhzf4q.b32.i2p", + "http://u6ikd6zndl3c4dsdq4mmujpntgeevdk5qzkfb57r4tnfeccrn2qa.b32.i2p", + "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p" + ], + "loki": [ + "http://nitter.priv.loki" + ] }, "bibliogram": { "normal": [ @@ -370,6 +379,7 @@ "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion" ], "i2p": [ + "http://wikiless.i2p", "http://hflqp2ejxygpj6cdwo3ogfieqmxw3b56w7dblt7bor2ltwk6kcfa.b32.i2p", "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p" ], @@ -381,7 +391,8 @@ "https://scribe.nixnet.services", "https://scribe.citizen4.eu", "https://scribe.bus-hit.me", - "https://scribe.froth.zone" + "https://scribe.froth.zone", + "https://scribe.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -452,7 +463,10 @@ "https://lingva.pussthecat.org", "https://translate.plausibility.cloud", "https://lingva.lunar.icu", - "https://lingva.opnxng.com" + "https://lingva.opnxng.com", + "https://translate.projectsegfau.lt", + "https://lingva.garudalinux.org", + "https://translate.dr460nf1r3.org" ], "tor": [], "i2p": [], @@ -478,8 +492,6 @@ "https://searx.netzspielplatz.de", "https://searx.nixnet.services", "https://searx.org", - "https://searx.priv.pw", - "https://searx.pwoss.org", "https://searx.rasp.fr", "https://searx.ru", "https://searx.run", @@ -489,6 +501,7 @@ "https://searx.tuxcloud.net", "https://searx.tyil.nl", "https://searx.vanwa.tech", + "https://searx.vimproved.me", "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", @@ -506,7 +519,8 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], "i2p": [ "http://ransack.i2p", @@ -519,7 +533,6 @@ "https://darmarit.org/searx", "https://de.xcxc.ml", "https://etsi.me", - "https://icanfindit.online", "https://jackgoss.xyz", "https://northboot.xyz", "https://opnxng.com", @@ -529,6 +542,7 @@ "https://s.frlt.one", "https://s.zhaocloud.net", "https://saber.tk", + "https://search.0relay.com", "https://search.affusio.com", "https://search.ashs.club", "https://search.bingowaves.xyz", @@ -561,33 +575,34 @@ "https://searx.mistli.net", "https://searx.namejeff.xyz", "https://searx.orion-hub.fr", + "https://searx.priv.pw", "https://searx.prvcy.eu", "https://searx.rimkus.it", "https://searx.sethforprivacy.com", "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", - "https://searx.vimproved.me", - "https://searx.youshitsune.me", "https://searx.zcyph.cc", "https://searxng.au/searx", "https://searxng.tordenskjold.de", "https://searxng.zackptg5.com", "https://serx.ml", + "https://sh0.it", "https://srx.cosmohub.io", "https://swag.pw", "https://www.gruble.de", "https://www.webrats.xyz", - "https://xcxc.ml" + "https://xcxc.ml", + "https://xo.wtf" ], "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", @@ -637,6 +652,7 @@ "normal": [ "https://i.bcow.xyz", "https://rimgo.pussthecat.org", + "https://rimgo.totaldarkness.net", "https://rimgo.bus-hit.me", "https://rimgo.esmailelbob.xyz", "https://rimgo.lunar.icu", @@ -662,16 +678,65 @@ "https://librarian.pussthecat.org", "https://lbry.mutahar.rocks", "https://librarian.esmailelbob.xyz", - "https://lbry.vern.cc" + "https://lbry.vern.cc", + "https://lbry.slipfox.xyz" ], "tor": [ "http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion" + ], + "i2p": [], + "loki": [] + }, + "neuters": { + "normal": [ + "https://neuters.de" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "beatbump": { + "normal": [ + "https://beatbump.ml" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "hyperpipe": { + "normal": [ + "https://hyperpipe.surge.sh", + "https://hyperpipe.esmailelbob.xyz" + ], + "tor": [], + "i2p": [], + "loki": [] + }, + "facil": { + "normal": [ + "https://facilmap.org" ], + "tor": [], + "i2p": [], + "loki": [] + }, + "simpleertube": { + "normal": [ + "https://tube.simple-web.org", + "https://simpleertube.esmailelbob.xyz", + "https://stube.tokhmi.xyz" + ], + "tor": [], "i2p": [], "loki": [] }, "peertube": [ + "https://tube.nogafa.org", + "https://www.neptube.io", + "https://tube.ghk-academy.info", + "https://pcbu.nl", "https://soberania.tv", "https://pire.artisanlogiciel.net", "https://trutube.xyz", @@ -728,7 +793,6 @@ "https://video.occm.cc", "https://peertube.viviers-fibre.net", "https://tube-action-educative.apps.education.fr", - "https://themadlads.live", "https://jahve.pl", "https://videos.yesil.club", "https://peertube.adjutor.xyz", @@ -787,7 +851,6 @@ "https://videos.neongarden.life", "https://video.vaku.org.ua", "https://videos.trom.lt", - "https://videod.fr", "https://vid.mkp.ca", "https://jupiter.tube", "https://tuvideo.encanarias.info", @@ -795,7 +858,6 @@ "https://peertube.chaunchy.com", "https://tube.vrpnet.org", "https://video.tii.space", - "https://peertube.familleboisteau.fr", "https://peertube.inubo.ch", "https://nightshift.minnix.dev", "https://tube.friloux.me", @@ -826,7 +888,6 @@ "https://video.niboe.info", "https://peertuibe.fedsinfo.nohost.me", "https://s9.gegenstimme.tv", - "https://pocketnetpeertube1.nohost.me", "https://videos.alamaisondulibre.org", "https://videos.tormentasolar.win", "https://tube.nestor.coop", @@ -850,7 +911,6 @@ "https://tube.rooty.fr", "https://tube.dnet.one", "https://peertube.io", - "https://peertube.echelon4.space", "https://www.kotikoff.net", "https://peertube.nz", "https://videos.grafo.zone", @@ -864,7 +924,6 @@ "https://krdtube.org", "https://peertube.elforcer.ru", "https://tubocatodico.bida.im", - "https://linhtran.eu", "https://torstenwitte.peertube-host.de", "https://peertube.hackerfraternity.org", "https://openmedia.edunova.it", @@ -931,7 +990,6 @@ "https://videos.slownewsdayshow.com", "https://videos.sarcasmstardust.com", "https://videos.factsonthegroundshow.com", - "https://video.regenpfeifer.net", "https://video.pe6.eu", "https://tv.santic-zombie.ru", "https://tube.sleeping.town", @@ -943,7 +1001,6 @@ "https://videos.ritimo.org", "https://videos.ephphatha.church", "https://video.cerclearistote.com", - "https://computerstuff.mooo.com", "https://video.greenmycity.eu", "https://przej.me", "https://pt.mezzo.moe", @@ -963,7 +1020,6 @@ "https://videos.yeswiki.net", "https://tube.lrk.sh", "https://peertube.autogestioncitoyenne.org", - "https://stream.dynacloud.ynh.fr", "https://video.r3s.nrw", "https://peertube.semweb.pro", "https://poast.tv", @@ -1026,7 +1082,6 @@ "https://peertube.home.x0r.fr", "https://peertube.marud.fr", "https://freetubehub.live", - "https://peertube.librelabucm.org", "https://mtube.mooo.com", "https://skeptube.fr", "https://tube.villejuif.fr", @@ -1044,7 +1099,6 @@ "https://tube.rfc1149.net", "https://tube.radiomercure.fr", "https://peertube.1984.cz", - "https://tube.sp4ke.com", "https://pt.nix.uno", "https://videos.openmandriva.org", "https://video.vanderwarker.photos", @@ -1183,7 +1237,6 @@ "https://tube.okcinfo.news", "https://www.rocaguinarda.tv", "https://videos.wirtube.de", - "https://tube.tinfoil-hat.net", "https://livegram.net", "https://video.ustim.ru", "https://merci-la-police.fr", @@ -1381,9 +1434,7 @@ "https://video.taboulisme.com", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", - "https://veezee.tube", "https://peertube.nicolastissot.fr", - "https://s2.veezee.tube", "https://tubes.jodh.us", "https://tube.lucie-philou.com", "https://video.odayacres.farm", @@ -1517,7 +1568,6 @@ "https://peertube.davigge.com", "https://vod.ksite.de", "https://tube.grin.hu", - "https://media.inno3.cricket", "https://tube.cryptography.dog", "https://peertube.zergy.net", "https://vid.ncrypt.at", @@ -1716,6 +1766,14 @@ "https://video.passageenseine.fr", "https://peertube.touhoppai.moe", "https://share.tube", - "https://peertube.heraut.eu" + "https://peertube.heraut.eu", + "https://peertube.gegeweb.eu", + "https://framatube.org", + "https://tube.conferences-gesticulees.net", + "https://peertube.datagueule.tv", + "https://video.lqdn.fr", + "https://peertube3.cpy.re", + "https://peertube2.cpy.re", + "https://peertube.cpy.re" ] } \ No newline at end of file -- cgit 1.4.1 From c3a5208fdcb052606bad1d8faf68ba00c18078ac Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 2 Aug 2022 18:16:17 +0300 Subject: Prettier format --- src/assets/javascripts/utils.js | 59 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index a6b011a3..23a882af 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -352,19 +352,19 @@ function copyCookie(frontend, targetUrl, urls, name) { for (const url of urls) { const setQuery = r.firstPartyIsolate ? { - url: url, - name: name, - value: cookie.value, - secure: true, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())) } break @@ -383,20 +383,20 @@ function getCookiesFromStorage(frontend, urls, name) { for (const url of urls) { let query = r.firstPartyIsolate ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: null, + firstPartyDomain: new URL(url).hostname, + } : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } + url: url, + name: cookie.name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } browser.cookies.set(query) } }) @@ -405,16 +405,16 @@ function getCookiesFromStorage(frontend, urls, name) { function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { - const http = new XMLHttpRequest(); + const http = new XMLHttpRequest() const url = `${targetUrl}${endpoint}` http.open("GET", url, false) http.setRequestHeader("Cookie", `${name}=${cookie.value}`) http.send(null) const preferences = JSON.parse(http.responseText) - let formdata = new FormData(); - for (var key in preferences) formdata.append(key, preferences[key]); + let formdata = new FormData() + for (var key in preferences) formdata.append(key, preferences[key]) for (const url of urls) { - const http = new XMLHttpRequest(); + const http = new XMLHttpRequest() http.open("POST", `${url}/settings/stay`, false) http.send(null) } @@ -424,7 +424,6 @@ function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { }) } - function copyRaw(test, copyRawElement) { return new Promise(resolve => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { -- cgit 1.4.1 From e618299a04f93c9769e3974c2b9f57171e8a5ea4 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 2 Aug 2022 19:50:40 +0300 Subject: Unify won't save in storage anymore. Fixed Piped Unify --- src/assets/javascripts/reddit.js | 62 ---------------- src/assets/javascripts/search.js | 101 -------------------------- src/assets/javascripts/tiktok.js | 24 ------ src/assets/javascripts/translate/translate.js | 51 ------------- src/assets/javascripts/twitter.js | 38 ---------- src/assets/javascripts/utils.js | 44 ++--------- src/assets/javascripts/wikipedia.js | 23 ------ src/assets/javascripts/youtube/youtube.js | 75 +------------------ src/pages/background/background.js | 11 --- src/pages/background/incognito.html | 35 --------- src/pages/background/incognito.js | 22 ------ src/pages/options/widgets/general.js | 44 +++-------- 12 files changed, 19 insertions(+), 511 deletions(-) delete mode 100644 src/pages/background/incognito.html delete mode 100644 src/pages/background/incognito.js diff --git a/src/assets/javascripts/reddit.js b/src/assets/javascripts/reddit.js index 699dcf1a..d1bf7b99 100644 --- a/src/assets/javascripts/reddit.js +++ b/src/assets/javascripts/reddit.js @@ -145,36 +145,6 @@ function initLibredditCookies(test, from) { }) } -function pasteLibredditCookies() { - return new Promise(async resolve => { - await init() - if (disableReddit || redditFrontend != "libreddit" || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...libredditLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...libredditI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects] - } - utils.getCookiesFromStorage("libreddit", checkedInstances, "theme") - utils.getCookiesFromStorage("libreddit", checkedInstances, "front_page") - utils.getCookiesFromStorage("libreddit", checkedInstances, "layout") - utils.getCookiesFromStorage("libreddit", checkedInstances, "wide") - utils.getCookiesFromStorage("libreddit", checkedInstances, "post_sort") - utils.getCookiesFromStorage("libreddit", checkedInstances, "comment_sort") - utils.getCookiesFromStorage("libreddit", checkedInstances, "show_nsfw") - utils.getCookiesFromStorage("libreddit", checkedInstances, "autoplay_videos") - utils.getCookiesFromStorage("libreddit", checkedInstances, "use_hls") - utils.getCookiesFromStorage("libreddit", checkedInstances, "hide_hls_notification") - utils.getCookiesFromStorage("libreddit", checkedInstances, "subscriptions") - utils.getCookiesFromStorage("libreddit", checkedInstances, "filters") - resolve() - }) -} - function initTedditCookies(test, from) { return new Promise(async resolve => { await init() @@ -211,36 +181,6 @@ function initTedditCookies(test, from) { }) } -function pasteTedditCookies() { - return new Promise(async resolve => { - await init() - if (disableReddit || redditFrontend != "teddit" || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...tedditLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...tedditI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects] - } - utils.getCookiesFromStorage("teddit", checkedInstances, "collapse_child_comments") - utils.getCookiesFromStorage("teddit", checkedInstances, "domain_instagram") - utils.getCookiesFromStorage("teddit", checkedInstances, "domain_twitter") - utils.getCookiesFromStorage("teddit", checkedInstances, "domain_youtube") - utils.getCookiesFromStorage("teddit", checkedInstances, "flairs") - utils.getCookiesFromStorage("teddit", checkedInstances, "highlight_controversial") - utils.getCookiesFromStorage("teddit", checkedInstances, "nsfw_enabled") - utils.getCookiesFromStorage("teddit", checkedInstances, "post_media_max_height") - utils.getCookiesFromStorage("teddit", checkedInstances, "show_upvoted_percentage") - utils.getCookiesFromStorage("teddit", checkedInstances, "show_upvotes") - utils.getCookiesFromStorage("teddit", checkedInstances, "theme") - utils.getCookiesFromStorage("teddit", checkedInstances, "videos_muted") - resolve() - }) -} - function all() { return [ ...redditRedirects.libreddit.normal, @@ -442,9 +382,7 @@ function initDefaults() { export default { setRedirects, initLibredditCookies, - pasteLibredditCookies, initTedditCookies, - pasteTedditCookies, redirect, initDefaults, diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index b076f5d0..2a5f4867 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -240,41 +240,6 @@ function initSearxCookies(test, from) { }) } -function pasteSearxCookies() { - return new Promise(async resolve => { - await init() - if (disableSearch || searchFrontend != "searx") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...searxLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...searxI2pCustomRedirects, ...searxI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...searxTorRedirectsChecks, ...searxTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects] - } - utils.getCookiesFromStorage("searx", checkedInstances, "advanced_search") - utils.getCookiesFromStorage("searx", checkedInstances, "autocomplete") - utils.getCookiesFromStorage("searx", checkedInstances, "categories") - utils.getCookiesFromStorage("searx", checkedInstances, "disabled_engines") - utils.getCookiesFromStorage("searx", checkedInstances, "disabled_plugins") - utils.getCookiesFromStorage("searx", checkedInstances, "doi_resolver") - utils.getCookiesFromStorage("searx", checkedInstances, "enabled_engines") - utils.getCookiesFromStorage("searx", checkedInstances, "enabled_plugins") - utils.getCookiesFromStorage("searx", checkedInstances, "image_proxy") - utils.getCookiesFromStorage("searx", checkedInstances, "language") - utils.getCookiesFromStorage("searx", checkedInstances, "locale") - utils.getCookiesFromStorage("searx", checkedInstances, "method") - utils.getCookiesFromStorage("searx", checkedInstances, "oscar-style") - utils.getCookiesFromStorage("searx", checkedInstances, "results_on_new_tab") - utils.getCookiesFromStorage("searx", checkedInstances, "safesearch") - utils.getCookiesFromStorage("searx", checkedInstances, "theme") - utils.getCookiesFromStorage("searx", checkedInstances, "tokens") - resolve() - }) -} - function initSearxngCookies(test, from) { return new Promise(async resolve => { await init() @@ -326,43 +291,6 @@ function initSearxngCookies(test, from) { }) } -function pasteSearxngCookies() { - return new Promise(async resolve => { - await init() - if ((disableSearch || searchFrontend != "searxng", protocol === undefined)) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...searxngLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...searxngI2pCustomRedirects, ...searxngI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects] - } - utils.getCookiesFromStorage("searxng", checkedInstances, "autocomplete") - utils.getCookiesFromStorage("searxng", checkedInstances, "categories") - utils.getCookiesFromStorage("searxng", checkedInstances, "disabled_engines") - utils.getCookiesFromStorage("searxng", checkedInstances, "disabled_plugins") - utils.getCookiesFromStorage("searxng", checkedInstances, "doi_resolver") - utils.getCookiesFromStorage("searxng", checkedInstances, "enabled_plugins") - utils.getCookiesFromStorage("searxng", checkedInstances, "enabled_engines") - utils.getCookiesFromStorage("searxng", checkedInstances, "image_proxy") - utils.getCookiesFromStorage("searxng", checkedInstances, "infinite_scroll") - utils.getCookiesFromStorage("searxng", checkedInstances, "language") - utils.getCookiesFromStorage("searxng", checkedInstances, "locale") - utils.getCookiesFromStorage("searxng", checkedInstances, "maintab") - utils.getCookiesFromStorage("searxng", checkedInstances, "method") - utils.getCookiesFromStorage("searxng", checkedInstances, "query_in_title") - utils.getCookiesFromStorage("searxng", checkedInstances, "results_on_new_tab") - utils.getCookiesFromStorage("searxng", checkedInstances, "safesearch") - utils.getCookiesFromStorage("searxng", checkedInstances, "simple_style") - utils.getCookiesFromStorage("searxng", checkedInstances, "theme") - utils.getCookiesFromStorage("searxng", checkedInstances, "tokens") - resolve() - }) -} - function initLibrexCookies(test, from) { return new Promise(async resolve => { await init() @@ -403,32 +331,6 @@ function initLibrexCookies(test, from) { }) } -function pasteLibrexCookies() { - return new Promise(async resolve => { - await init() - if ((disableSearch || searchFrontend != "librex", protocol === undefined)) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...librexLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...librexI2pCustomRedirects, ...librexI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...librexTorRedirectsChecks, ...librexTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...librexNormalRedirectsChecks, ...librexNormalCustomRedirects] - } - utils.getCookiesFromStorage("librex", checkedInstances, "bibliogram") - utils.getCookiesFromStorage("librex", checkedInstances, "disable_special") - utils.getCookiesFromStorage("librex", checkedInstances, "invidious") - utils.getCookiesFromStorage("librex", checkedInstances, "libreddit") - utils.getCookiesFromStorage("librex", checkedInstances, "nitter") - utils.getCookiesFromStorage("librex", checkedInstances, "proxitok") - utils.getCookiesFromStorage("librex", checkedInstances, "theme") - utils.getCookiesFromStorage("librex", checkedInstances, "wikiless") - resolve() - }) -} - function redirect(url, disableOverride) { if (disableSearch && !disableOverride) return if (!targets.some(rx => rx.test(url.href))) return @@ -691,11 +593,8 @@ function initDefaults() { export default { setRedirects, initSearxCookies, - pasteSearxCookies, initSearxngCookies, - pasteSearxngCookies, initLibrexCookies, - pasteLibrexCookies, redirect, initDefaults, switchInstance, diff --git a/src/assets/javascripts/tiktok.js b/src/assets/javascripts/tiktok.js index ba4a9ff1..9d2660d4 100644 --- a/src/assets/javascripts/tiktok.js +++ b/src/assets/javascripts/tiktok.js @@ -62,26 +62,6 @@ function initProxiTokCookies(test, from) { }) } -function pasteProxiTokCookies() { - return new Promise(async resolve => { - await init() - if (disableTiktok || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...proxiTokI2pCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...proxiTokLokiCustomRedirects] - else if (protocol == "tor") checkedInstances = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects] - } - utils.getCookiesFromStorage("proxitok", checkedInstances, "theme") - utils.getCookiesFromStorage("proxitok", checkedInstances, "api-legacy") - resolve() - }) -} - let disableTiktok, protocol, protocolFallback, @@ -248,13 +228,9 @@ function initDefaults() { export default { setRedirects, - redirect, reverse, switchInstance, - initProxiTokCookies, - pasteProxiTokCookies, - initDefaults, } diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 5512f7f1..893be4e2 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -160,33 +160,6 @@ function copyPasteLingvaLocalStorage(test, url, tabId) { }) } -function pasteLingvaLocalStorage() { - return new Promise(async resolve => { - await init() - if (translateDisable || translateFrontend != "lingva") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...lingvaLokiCustomRedirects] - //...lingvaLokiRedirectsChecks, - else if (protocol == "i2p") checkedInstances = [...lingvaI2pCustomRedirects] - //...lingvaI2pRedirectsChecks, - else if (protocol == "tor") checkedInstances = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects] - } - for (const to of checkedInstances) - browser.tabs.create({ url: to }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/translate/set_lingva_preferences.js", - runAt: "document_start", - }) - ) - resolve() - }) -} - function copyPasteSimplyTranslateCookies(test, from) { return new Promise(async resolve => { await init() @@ -223,28 +196,6 @@ function copyPasteSimplyTranslateCookies(test, from) { }) } -function pasteSimplyTranslateCookies() { - return new Promise(async resolve => { - await init() - if (translateDisable || translateFrontend != "simplyTranslate") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...simplyTranslateI2pCustomRedirects, ...simplyTranslateI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects] - } - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "from_lang") - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "to_lang") - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "tts_enabled") - utils.getCookiesFromStorage("simplyTranslate", checkedInstances, "use_text_fields") - resolve() - }) -} - function redirect(url, disableOverride) { if (translateDisable && !disableOverride) return if (!targets.some(rx => rx.test(url.href))) return @@ -403,9 +354,7 @@ function initDefaults() { export default { copyPasteSimplyTranslateCookies, - pasteSimplyTranslateCookies, copyPasteLingvaLocalStorage, - pasteLingvaLocalStorage, setRedirects, redirect, initDefaults, diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 1ec4d8eb..b3c33560 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -215,43 +215,6 @@ function initNitterCookies(test, from) { }) } -function pasteNitterCookies() { - return new Promise(async resolve => { - await init() - if (disableTwitter || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...nitterI2pCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...nitterLokiCustomRedirects] - else if (protocol == "tor") checkedInstances = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects] - } - utils.getCookiesFromStorage("nitter", checkedInstances, "theme") - utils.getCookiesFromStorage("nitter", checkedInstances, "infiniteScroll") - utils.getCookiesFromStorage("nitter", checkedInstances, "stickyProfile") - utils.getCookiesFromStorage("nitter", checkedInstances, "bidiSupport") - utils.getCookiesFromStorage("nitter", checkedInstances, "hideTweetStats") - utils.getCookiesFromStorage("nitter", checkedInstances, "hideBanner") - utils.getCookiesFromStorage("nitter", checkedInstances, "hidePins") - utils.getCookiesFromStorage("nitter", checkedInstances, "hideReplies") - utils.getCookiesFromStorage("nitter", checkedInstances, "squareAvatars") - utils.getCookiesFromStorage("nitter", checkedInstances, "mp4Playback") - utils.getCookiesFromStorage("nitter", checkedInstances, "hlsPlayback") - utils.getCookiesFromStorage("nitter", checkedInstances, "proxyVideos") - utils.getCookiesFromStorage("nitter", checkedInstances, "muteVideos") - utils.getCookiesFromStorage("nitter", checkedInstances, "autoplayGifs") - - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceInstagram") - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceReddit") - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceTwitter") - utils.getCookiesFromStorage("nitter", checkedInstances, "replaceYouTube") - resolve() - }) -} - function initDefaults() { return new Promise(resolve => { fetch("/instances/data.json") @@ -299,6 +262,5 @@ export default { reverse, removeXFrameOptions, initNitterCookies, - pasteNitterCookies, initDefaults, } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 23a882af..d881eba1 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -339,7 +339,11 @@ function copyCookie(frontend, targetUrl, urls, name) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { let query - if (!r.firstPartyIsolate) query = { url: protocolHost(targetUrl), name: name } + if (!r.firstPartyIsolate) + query = { + url: protocolHost(targetUrl), + name: name, + } else query = { url: protocolHost(targetUrl), @@ -365,7 +369,7 @@ function copyCookie(frontend, targetUrl, urls, name) { secure: true, expirationDate: cookie.expirationDate, } - browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())) + browser.cookies.set(setQuery) } break } @@ -375,33 +379,6 @@ function copyCookie(frontend, targetUrl, urls, name) { }) } -function getCookiesFromStorage(frontend, urls, name) { - let key = `${frontend}_${name}` - browser.storage.local.get([key, "firstPartyIsolate"], r => { - const cookie = r[key] - if (cookie === undefined) return - for (const url of urls) { - let query = r.firstPartyIsolate - ? { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: null, - firstPartyDomain: new URL(url).hostname, - } - : { - url: url, - name: cookie.name, - value: cookie.value, - secure: true, - expirationDate: cookie.expirationDate, - } - browser.cookies.set(query) - } - }) -} - function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { return new Promise(resolve => { browser.storage.local.get("firstPartyIsolate", r => { @@ -474,10 +451,6 @@ function unify(test) { resolve() return } - if (currTab.incognito) { - resolve() - return - } let result = await youtubeHelper.copyPasteInvidiousCookies(test, url) if (!result) result = await youtubeHelper.copyPastePipedLocalStorage(test, url, currTab.id) @@ -540,8 +513,8 @@ function switchInstance(test) { } function latency(name, frontend, document, location) { - let latencyElement = document.getElementById(`latency - ${frontend} `) - let latencyLabel = document.getElementById(`latency - ${frontend} -label`) + let latencyElement = document.getElementById(`latency-${frontend}`) + let latencyLabel = document.getElementById(`latency-${frontend}-label`) latencyElement.addEventListener("click", async () => { let reloadWindow = () => location.reload() latencyElement.addEventListener("click", reloadWindow) @@ -567,7 +540,6 @@ export default { processDefaultCustomInstances, latency, copyCookie, - getCookiesFromStorage, getPreferencesFromToken, switchInstance, copyRaw, diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index cf19b208..04191d1a 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -113,26 +113,6 @@ function initWikilessCookies(test, from) { }) } -function pasteWikilessCookies() { - return new Promise(async resolve => { - await init() - if (disableWikipedia || protocol === undefined) { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...wikilessLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks] - else if (protocol == "tor") checkedInstances = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects] - } - utils.getCookiesFromStorage("wikiless", checkedInstances, "theme") - utils.getCookiesFromStorage("wikiless", checkedInstances, "default_lang") - resolve() - }) -} - function redirect(url, disableOverride) { if (disableWikipedia && !disableOverride) return if (!targets.test(url.href)) return @@ -252,10 +232,7 @@ function initDefaults() { export default { setRedirects, - initWikilessCookies, - pasteWikilessCookies, - redirect, initDefaults, switchInstance, diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index e8a77ff6..7e02dcd2 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -573,25 +573,6 @@ function copyPasteInvidiousCookies(test, from) { }) } -function pasteInvidiousCookies() { - return new Promise(async resolve => { - await init() - if (disableYoutube || youtubeFrontend != "invidious") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...invidiousLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...invidiousI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects] - if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects] - } - utils.getCookiesFromStorage("invidious", checkedInstances, "PREFS") - resolve() - }) -} - function copyPastePipedLocalStorage(test, url, tabId) { return new Promise(async resolve => { await init() @@ -619,7 +600,7 @@ function copyPastePipedLocalStorage(test, url, tabId) { if (protocol == "loki") checkedInstances = [...pipedLokiCustomRedirects] else if (protocol == "i2p") checkedInstances = [...pipedI2pCustomRedirects] else if (protocol == "tor") checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { + if ((checkedInstances.length === 0 && protocolFallback) || protocol == "normal") { checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks] } const i = checkedInstances.indexOf(protocolHost) @@ -636,31 +617,6 @@ function copyPastePipedLocalStorage(test, url, tabId) { resolve(true) }) } -function pastePipedLocalStorage() { - return new Promise(async resolve => { - await init() - if (disableYoutube || youtubeFrontend != "piped") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...pipedLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...pipedI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks] - } - for (const to of checkedInstances) { - browser.tabs.create({ url: to }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/youtube/set_piped_preferences.js", - runAt: "document_start", - }) - ) - } - resolve() - }) -} function copyPastePipedMaterialLocalStorage(test, url, tabId) { return new Promise(async resolve => { @@ -711,32 +667,6 @@ function copyPastePipedMaterialLocalStorage(test, url, tabId) { }) } -function pastePipedMaterialLocalStorage() { - return new Promise(async resolve => { - await init() - if (disableYoutube || youtubeFrontend != "pipedMaterial") { - resolve() - return - } - let checkedInstances = [] - if (protocol == "loki") checkedInstances = [...pipedMaterialLokiCustomRedirects] - else if (protocol == "i2p") checkedInstances = [...pipedMaterialI2pCustomRedirects] - else if (protocol == "tor") checkedInstances = [...pipedMaterialTorCustomRedirects] //...pipedMaterialTorRedirectsChecks, - if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { - checkedInstances = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects] - } - for (const to of checkedInstances) { - browser.tabs.create({ url: to }, tab => - browser.tabs.executeScript(tab.id, { - file: "/assets/javascripts/youtube/set_pipedMaterial_preferences.js", - runAt: "document_start", - }) - ) - } - resolve() - }) -} - function removeXFrameOptions(e) { let isChanged = false @@ -843,11 +773,8 @@ function removeXFrameOptions(e) { export default { setRedirects, copyPastePipedLocalStorage, - pastePipedLocalStorage, copyPastePipedMaterialLocalStorage, - pastePipedMaterialLocalStorage, copyPasteInvidiousCookies, - pasteInvidiousCookies, redirect, reverse, switchInstance, diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 359a912d..a1b0c9c6 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -71,17 +71,6 @@ browser.runtime.onInstalled.addListener(details => { // } }) -youtubeHelper.pasteInvidiousCookies() -translateHelper.pasteSimplyTranslateCookies() -twitterHelper.pasteNitterCookies() -wikipediaHelper.pasteWikilessCookies() -searchHelper.pasteSearxCookies() -searchHelper.pasteSearxngCookies() -searchHelper.pasteLibrexCookies() -redditHelper.pasteLibredditCookies() -redditHelper.pasteTedditCookies() -tiktokHelper.pasteProxiTokCookies() - let BYPASSTABs = [] browser.webRequest.onBeforeRequest.addListener( details => { diff --git a/src/pages/background/incognito.html b/src/pages/background/incognito.html deleted file mode 100644 index 227d99e4..00000000 --- a/src/pages/background/incognito.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - Initializing Cookies - - - - - -
-

Initializing Cookies...

-
- - - diff --git a/src/pages/background/incognito.js b/src/pages/background/incognito.js deleted file mode 100644 index c7ed2b7d..00000000 --- a/src/pages/background/incognito.js +++ /dev/null @@ -1,22 +0,0 @@ -import youtubeHelper from "../../assets/javascripts/youtube/youtube.js" -import twitterHelper from "../../assets/javascripts/twitter.js" -import redditHelper from "../../assets/javascripts/reddit.js" -import searchHelper from "../../assets/javascripts/search.js" -import translateHelper from "../../assets/javascripts/translate/translate.js" -import wikipediaHelper from "../../assets/javascripts/wikipedia.js" -import tiktokHelper from "../../assets/javascripts/tiktok.js" - -window.browser = window.browser || window.chrome - -await youtubeHelper.pasteInvidiousCookies() -await translateHelper.pasteSimplyTranslateCookies() -await twitterHelper.pasteNitterCookies() -await wikipediaHelper.pasteWikilessCookies() -await searchHelper.pasteSearxCookies() -await searchHelper.pasteSearxngCookies() -await searchHelper.pasteLibrexCookies() -await redditHelper.pasteLibredditCookies() -await redditHelper.pasteTedditCookies() -await tiktokHelper.pasteProxiTokCookies() - -window.close() diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 56439a95..c64eb25d 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -56,31 +56,7 @@ 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 }, async () => { - await youtubeHelper.pasteInvidiousCookies() - await youtubeHelper.pastePipedLocalStorage() - await youtubeHelper.pastePipedMaterialLocalStorage() - - await translateHelper.pasteSimplyTranslateCookies() - await translateHelper.pasteLingvaLocalStorage() - - await twitterHelper.pasteNitterCookies() - - await wikipediaHelper.pasteWikilessCookies() - - await searchHelper.pasteSearxCookies() - await searchHelper.pasteSearxngCookies() - await searchHelper.pasteLibrexCookies() - - await redditHelper.pasteLibredditCookies() - await redditHelper.pasteTedditCookies() - - await tiktokHelper.pasteProxiTokCookies() - - location.reload() - }) - }) + browser.storage.local.clear(() => browser.storage.local.set({ ...data }, () => location.reload())) } else { console.log("incompatible settings") importError() @@ -156,14 +132,14 @@ protocolFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ protocolFallback: event.target.checked }) }) -let latencyOutput = document.getElementById("latency-output") -let latencyInput = document.getElementById("latency-input") -latencyInput.addEventListener("change", event => { - browser.storage.local.set({ latencyThreshold: event.target.value}) -}) -latencyInput.addEventListener("input", event => { - latencyOutput.value = event.target.value -}) +// let latencyOutput = document.getElementById("latency-output") +// let latencyInput = document.getElementById("latency-input") +// latencyInput.addEventListener("change", event => { +// browser.storage.local.set({ latencyThreshold: event.target.value }) +// }) +// latencyInput.addEventListener("input", event => { +// latencyOutput.value = event.target.value +// }) let nameCustomInstanceInput = document.getElementById("exceptions-custom-instance") let instanceTypeElement = document.getElementById("exceptions-custom-instance-type") @@ -198,7 +174,7 @@ browser.storage.local.get( themeElement.value = r.theme protocolElement.value = r.protocol protocolFallbackCheckbox.checked = r.protocolFallback - latencyOutput.value = r.latencyThreshold + // latencyOutput.value = r.latencyThreshold // firstPartyIsolate.checked = r.firstPartyIsolate; let protocolFallbackElement = document.getElementById("protocol-fallback") -- cgit 1.4.1 From df563552e32e66d860d2ab42d48fd12bb975f35f Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 27 Jul 2022 16:13:53 +0000 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9e68391..4de39765 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ npm run start ### Install temporarily open `about:addons`\ -click on the settings button below the addon search bar and select `debug add-on`\ +type in the address bar `about:debugging`\ press `load temporarily addon` ### Install in Firefox ESR, Developer Edition, Nightly -- cgit 1.4.1 From fe0a2782e47c55149e2c46fb79d1150dc191c8e6 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 28 Jul 2022 22:35:02 +0000 Subject: update instances --- src/assets/javascripts/translate/translate.js | 2 +- src/instances/blacklist.json | 4 ++-- src/instances/data.json | 12 +++++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 893be4e2..2c500759 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -271,7 +271,7 @@ function switchInstance(url, disableOverride) { return } - let instancesList + let instancesList = [] if (protocol == "loki") { if (translateFrontend == "simplyTranslate") instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects] diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 221058ee..2d93adc8 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -4,9 +4,8 @@ "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://jp-piped.shimul.me", + "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", @@ -62,6 +61,7 @@ "https://n.hyperborea.cloud", "https://nitter.spaceint.fr", "https://bibliogram.snopyta.org", + "https://libredd.it", "https://libreddit.autarkic.org", "https://libreddit.notyourcomputer.net", "https://anon.sx", diff --git a/src/instances/data.json b/src/instances/data.json index c5334a47..a1414dbc 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -12,6 +12,7 @@ "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", "https://inv.bp.projectsegfau.lt", + "https://invidious.projectsegfau.lt", "https://inv.vern.cc", "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", @@ -19,7 +20,6 @@ "https://youtube.076.ne.jp", "https://invidious.weblibre.org", "https://invidious.snopyta.org", - "https://invidious.projectsegfau.lt", "https://invidious.esmailelbob.xyz", "https://invidious.namazso.eu" ], @@ -43,9 +43,8 @@ "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://il.ax", - "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://jp-piped.shimul.me", + "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", @@ -501,7 +500,6 @@ "https://searx.tuxcloud.net", "https://searx.tyil.nl", "https://searx.vanwa.tech", - "https://searx.vimproved.me", "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", @@ -519,8 +517,7 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" ], "i2p": [ "http://ransack.i2p", @@ -582,6 +579,7 @@ "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", + "https://searx.vimproved.me", "https://searx.zcyph.cc", "https://searxng.au/searx", "https://searxng.tordenskjold.de", @@ -603,6 +601,7 @@ "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", @@ -820,7 +819,6 @@ "https://tube-enseignement-professionnel.apps.education.fr", "https://socpeertube.ru", "https://videos.laliguepaysdelaloire.org", - "https://videotube.duckdns.org", "https://quantube.win", "https://twctube.twc-zone.eu", "https://vhs.absturztau.be", -- cgit 1.4.1 From d436d6a18a909cd504064405c4747f8d842aaf4b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 31 Jul 2022 22:35:05 +0000 Subject: update instances --- src/instances/data.json | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/instances/data.json b/src/instances/data.json index a1414dbc..e45d5221 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -3,6 +3,10 @@ "normal": [ "https://yewtu.be", "https://vid.puffyan.us", +<<<<<<< HEAD +======= + "https://invidious.snopyta.org", +>>>>>>> 0b6c717 (update instances) "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", @@ -17,11 +21,18 @@ "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", +<<<<<<< HEAD "https://youtube.076.ne.jp", "https://invidious.weblibre.org", "https://invidious.snopyta.org", "https://invidious.esmailelbob.xyz", "https://invidious.namazso.eu" +======= + "https://invidious.weblibre.org", + "https://youtube.076.ne.jp", + "https://invidious.namazso.eu", + "https://invidious.esmailelbob.xyz" +>>>>>>> 0b6c717 (update instances) ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -49,6 +60,11 @@ "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", +<<<<<<< HEAD +======= + "https://piped.mint.lgbt", + "https://piped.privacy.com.de", +>>>>>>> 0b6c717 (update instances) "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], @@ -483,6 +499,7 @@ "https://searx.bissisoft.com", "https://searx.divided-by-zero.eu", "https://searx.dresden.network", + "https://searx.ebnar.xyz", "https://searx.fossencdi.org", "https://searx.gnu.style", "https://searx.mastodontech.de", @@ -517,7 +534,12 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", +<<<<<<< HEAD "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" +======= + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx" +>>>>>>> 0b6c717 (update instances) ], "i2p": [ "http://ransack.i2p", @@ -562,7 +584,6 @@ "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", - "https://searx.ebnar.xyz", "https://searx.ericaftereric.top", "https://searx.esmailelbob.xyz", "https://searx.fi", @@ -604,7 +625,6 @@ "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", - "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" ], @@ -732,7 +752,10 @@ "loki": [] }, "peertube": [ +<<<<<<< HEAD "https://tube.nogafa.org", +======= +>>>>>>> 0b6c717 (update instances) "https://www.neptube.io", "https://tube.ghk-academy.info", "https://pcbu.nl", -- cgit 1.4.1 From 341afc4055f292535fb9097ffcaff25b38c3c953 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 21:55:17 +0100 Subject: Finish offline detection --- src/assets/javascripts/imdb.js | 13 ++++- src/assets/javascripts/imgur.js | 57 ++++++------------- src/assets/javascripts/instagram.js | 18 +++--- src/assets/javascripts/lbry.js | 13 ++++- src/assets/javascripts/maps.js | 13 ++++- src/assets/javascripts/medium.js | 18 +++--- src/assets/javascripts/peertube.js | 18 +++--- src/assets/javascripts/quora.js | 13 ++++- src/assets/javascripts/reddit.js | 30 +++++----- src/assets/javascripts/reuters.js | 13 ++++- src/assets/javascripts/search.js | 79 +++++++-------------------- src/assets/javascripts/sendTargets.js | 18 +++--- src/assets/javascripts/tiktok.js | 14 ++++- src/assets/javascripts/translate/translate.js | 35 +++++++----- src/assets/javascripts/twitter.js | 21 ++++--- src/assets/javascripts/utils.js | 23 +++----- src/assets/javascripts/wikipedia.js | 18 +++--- src/assets/javascripts/youtube/youtube.js | 21 +++---- src/assets/javascripts/youtubeMusic.js | 30 +++++----- src/pages/background/background.js | 40 +++++++------- src/pages/options/index.html | 2 +- src/pages/options/widgets/general.js | 2 + 22 files changed, 244 insertions(+), 265 deletions(-) diff --git a/src/assets/javascripts/imdb.js b/src/assets/javascripts/imdb.js index 9981f1b9..1f6c7a5f 100644 --- a/src/assets/javascripts/imdb.js +++ b/src/assets/javascripts/imdb.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.libremdb = val libremdbNormalRedirectsChecks = [...redirects.libremdb.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = libremdbNormalRedirectsChecks.indexOf(instance) if (a > -1) libremdbNormalRedirectsChecks.splice(a, 1) } @@ -172,12 +172,18 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + libremdbNormalRedirectsChecks = [...redirects.libremdb.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = libremdbNormalRedirectsChecks.indexOf(instance) + if (a > -1) libremdbNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableImdb: true, imdbRedirects: redirects, - libremdbNormalRedirectsChecks: [...redirects.libremdb.normal], + libremdbNormalRedirectsChecks, libremdbNormalCustomRedirects: [], libremdbTorRedirectsChecks: [...redirects.libremdb.tor], @@ -192,6 +198,7 @@ function initDefaults() { () => resolve() ) }) + }) }) } diff --git a/src/assets/javascripts/imgur.js b/src/assets/javascripts/imgur.js index 9ccd24af..25f61f06 100644 --- a/src/assets/javascripts/imgur.js +++ b/src/assets/javascripts/imgur.js @@ -16,39 +16,18 @@ for (let i = 0; i < frontends.length; i++) { } } -function setRedirects() { - return new Promise(resolve => { - fetch("/instances/data.json") - .then(response => response.text()) - .then(async data => { - let dataJson = JSON.parse(data) - redirects.rimgo = dataJson.rimgo - - rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] - rimgoTorRedirectsChecks = [...redirects.rimgo.tor] - rimgoI2pRedirectsChecks = [...redirects.rimgo.i2p] - - for (const instance of r.cloudflareBlackList) { - const a = rimgoNormalRedirectsChecks.indexOf(instance) - if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) - - const b = rimgoTorRedirectsChecks.indexOf(instance) - if (b > -1) rimgoTorRedirectsChecks.splice(b, 1) - - const c = rimgoI2pRedirectsChecks.indexOf(instance) - if (c > -1) rimgoI2pRedirectsChecks.splice(c, 1) - } - - browser.storage.local.set( - { - imgurRedirects: redirects, - rimgoNormalRedirectsChecks, - rimgoTorRedirectsChecks, - rimgoI2pRedirectsChecks, - }, - () => resolve() - ) - }) +function setRedirects(val) { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.rimgo = val + rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = rimgoNormalRedirectsChecks.indexOf(instance) + if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set({ + imgurRedirects: redirects, + rimgoNormalRedirectsChecks, + }) }) } @@ -195,12 +174,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] - for (const instance of r.cloudflareBlackList) { - const i = rimgoNormalRedirectsChecks.indexOf(instance) - if (i > -1) rimgoNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = rimgoNormalRedirectsChecks.indexOf(instance) + if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableImgur: false, diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 00042074..a65dac80 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -16,10 +16,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", async r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { redirects.bibliogram = val bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = bibliogramNormalRedirectsChecks.indexOf(instance) if (a > -1) bibliogramNormalRedirectsChecks.splice(a, 1) } @@ -203,17 +203,17 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", r => { - bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] - for (const instance of r.cloudflareBlackList) { - const i = bibliogramNormalRedirectsChecks.indexOf(instance) - if (i > -1) bibliogramNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = bibliogramNormalRedirectsChecks.indexOf(instance) + if (a > -1) bibliogramNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set({ disableInstagram: false, instagramRedirects: redirects, - bibliogramNormalRedirectsChecks: bibliogramNormalRedirectsChecks, + bibliogramNormalRedirectsChecks, bibliogramNormalCustomRedirects: [], bibliogramTorRedirectsChecks: [...redirects.bibliogram.tor], diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index 0c4d34cc..b1e6f477 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.librarian = val librarianNormalRedirectsChecks = [...redirects.librarian.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = librarianNormalRedirectsChecks.indexOf(instance) if (a > -1) librarianNormalRedirectsChecks.splice(a, 1) } @@ -175,6 +175,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + librarianNormalRedirectsChecks = [...redirects.librarian.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = librarianNormalRedirectsChecks.indexOf(instance) + if (a > -1) librarianNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableLbryTargets: true, @@ -182,7 +188,7 @@ function initDefaults() { lbryTargetsRedirects: redirects, lbryRedirectType: "both", - librarianNormalRedirectsChecks: [...redirects.librarian.normal], + librarianNormalRedirectsChecks, librarianNormalCustomRedirects: [], librarianTorRedirectsChecks: [...redirects.librarian.tor], @@ -197,6 +203,7 @@ function initDefaults() { () => resolve() ) }) + }) }) } diff --git a/src/assets/javascripts/maps.js b/src/assets/javascripts/maps.js index 9fb10b9d..6627faff 100644 --- a/src/assets/javascripts/maps.js +++ b/src/assets/javascripts/maps.js @@ -21,10 +21,10 @@ redirects.osm = {} redirects.osm.normal = ["https://www.openstreetmap.org"] function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.facil = val facilNormalRedirectsChecks = [...redirects.facil.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = facilNormalRedirectsChecks.indexOf(instance) if (a > -1) facilNormalRedirectsChecks.splice(a, 1) } @@ -264,12 +264,18 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + facilNormalRedirectsChecks = [...redirects.facil.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = facilNormalRedirectsChecks.indexOf(instance) + if (a > -1) facilNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableMaps: false, mapsFrontend: "osm", mapsRedirects: redirects, - facilNormalRedirectsChecks: [...redirects.facil.normal], + facilNormalRedirectsChecks, facilNormalCustomRedirects: [], facilTorRedirectsChecks: [...redirects.facil.tor], @@ -284,6 +290,7 @@ function initDefaults() { () => resolve() ) }) + }) }) } diff --git a/src/assets/javascripts/medium.js b/src/assets/javascripts/medium.js index 4c03471c..f1dcf2e2 100644 --- a/src/assets/javascripts/medium.js +++ b/src/assets/javascripts/medium.js @@ -40,10 +40,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.scribe = val scribeNormalRedirectsChecks = [...redirects.scribe.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = scribeNormalRedirectsChecks.indexOf(instance) if (a > -1) scribeNormalRedirectsChecks.splice(a, 1) } @@ -181,18 +181,18 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - scribeNormalRedirectsChecks = [...redirects.scribe.normal] - for (const instance of r.cloudflareBlackList) { - let i = scribeNormalRedirectsChecks.indexOf(instance) - if (i > -1) scribeNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + scribeNormalRedirectsChecks = [...redirects.scribe.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = scribeNormalRedirectsChecks.indexOf(instance) + if (a > -1) scribeNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableMedium: false, mediumRedirects: redirects, - scribeNormalRedirectsChecks: scribeNormalRedirectsChecks, + scribeNormalRedirectsChecks, scribeNormalCustomRedirects: [], scribeTorRedirectsChecks: [...redirects.scribe.tor], diff --git a/src/assets/javascripts/peertube.js b/src/assets/javascripts/peertube.js index de25cfaa..df95611c 100644 --- a/src/assets/javascripts/peertube.js +++ b/src/assets/javascripts/peertube.js @@ -15,10 +15,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.simpleertube = val simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = simpleertubeNormalRedirectsChecks.indexOf(instance) if (a > -1) simpleertubeNormalRedirectsChecks.splice(a, 1) } @@ -162,19 +162,19 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] - for (const instance of r.cloudflareBlackList) { - let i = simpleertubeNormalRedirectsChecks.indexOf(instance) - if (i > -1) simpleertubeNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simpleertubeNormalRedirectsChecks.indexOf(instance) + if (a > -1) simpleertubeNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { peerTubeTargets: ["https://search.joinpeertube.org", ...dataJson.peertube], disablePeertubeTargets: true, peertubeRedirects: redirects, - simpleertubeNormalRedirectsChecks: simpleertubeNormalRedirectsChecks, + simpleertubeNormalRedirectsChecks, simpleertubeNormalCustomRedirects: [], simpleertubeTorRedirectsChecks: [...redirects.simpleertube.tor], diff --git a/src/assets/javascripts/quora.js b/src/assets/javascripts/quora.js index 3f9e4189..4d8249f8 100644 --- a/src/assets/javascripts/quora.js +++ b/src/assets/javascripts/quora.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.quetre = val quetreNormalRedirectsChecks = [...redirects.quetre.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = quetreNormalRedirectsChecks.indexOf(instance) if (a > -1) quetreNormalRedirectsChecks.splice(a, 1) } @@ -157,13 +157,19 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + quetreNormalRedirectsChecks = [...redirects.quetre.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = quetreNormalRedirectsChecks.indexOf(instance) + if (a > -1) quetreNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableQuora: false, quoraRedirects: redirects, - quetreNormalRedirectsChecks: [...redirects.quetre.normal], + quetreNormalRedirectsChecks, quetreNormalCustomRedirects: [], quetreTorRedirectsChecks: [...redirects.quetre.tor], @@ -178,6 +184,7 @@ function initDefaults() { () => resolve() ) }) + }) }) } diff --git a/src/assets/javascripts/reddit.js b/src/assets/javascripts/reddit.js index d1bf7b99..2a07dffb 100644 --- a/src/assets/javascripts/reddit.js +++ b/src/assets/javascripts/reddit.js @@ -16,11 +16,11 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects = val libredditNormalRedirectsChecks = [...redirects.libreddit.normal] tedditNormalRedirectsChecks = [...redirects.teddit.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = libredditNormalRedirectsChecks.indexOf(instance) if (a > -1) libredditNormalRedirectsChecks.splice(a, 1) @@ -330,25 +330,23 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - libredditNormalRedirectsChecks = [...redirects.libreddit.normal] - tedditNormalRedirectsChecks = [...redirects.teddit.normal] - for (const instance of r.cloudflareBlackList) { - let i - - i = libredditNormalRedirectsChecks.indexOf(instance) - if (i > -1) libredditNormalRedirectsChecks.splice(i, 1) - - i = tedditNormalRedirectsChecks.indexOf(instance) - if (i > -1) tedditNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + libredditNormalRedirectsChecks = [...redirects.libreddit.normal] + tedditNormalRedirectsChecks = [...redirects.teddit.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = libredditNormalRedirectsChecks.indexOf(instance) + if (a > -1) libredditNormalRedirectsChecks.splice(a, 1) + + const b = tedditNormalRedirectsChecks.indexOf(instance) + if (b > -1) tedditNormalRedirectsChecks.splice(b, 1) + } browser.storage.local.set( { disableReddit: false, redditFrontend: "libreddit", redditRedirects: redirects, - libredditNormalRedirectsChecks: libredditNormalRedirectsChecks, + libredditNormalRedirectsChecks, libredditNormalCustomRedirects: [], libredditTorRedirectsChecks: [...redirects.libreddit.tor], @@ -360,7 +358,7 @@ function initDefaults() { libredditLokiRedirectsChecks: [...redirects.libreddit.loki], libredditLokiCustomRedirects: [], - tedditNormalRedirectsChecks: tedditNormalRedirectsChecks, + tedditNormalRedirectsChecks, tedditNormalCustomRedirects: [], tedditTorRedirectsChecks: [...redirects.teddit.tor], diff --git a/src/assets/javascripts/reuters.js b/src/assets/javascripts/reuters.js index e4afa19c..78f5077b 100644 --- a/src/assets/javascripts/reuters.js +++ b/src/assets/javascripts/reuters.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.neuters = val neutersNormalRedirectsChecks = [...redirects.neuters.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = neutersNormalRedirectsChecks.indexOf(instance) if (a > -1) neutersNormalRedirectsChecks.splice(a, 1) } @@ -109,13 +109,19 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + neutersNormalRedirectsChecks = [...redirects.neuters.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = neutersNormalRedirectsChecks.indexOf(instance) + if (a > -1) neutersNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableReuters: true, reutersRedirects: redirects, - neutersNormalRedirectsChecks: [...redirects.neuters.normal], + neutersNormalRedirectsChecks, neutersNormalCustomRedirects: [], neutersTorRedirectsChecks: [...redirects.neuters.tor], @@ -130,6 +136,7 @@ function initDefaults() { () => resolve() ) }) + }) }) } diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index 2a5f4867..04b5b8d4 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -8,52 +8,22 @@ const frontends = new Array("searx", "searxng", "whoogle", "librex") const protocols = new Array("normal", "tor", "i2p", "loki") const redirects = {} -/* - "searx": { - "normal": [], - "tor": [], - "i2p": [] - }, - "searxng": { - "normal": [], - "tor": [], - "i2p": [] - }, - "whoogle": { - "normal": [], - "tor": [], - "i2p": [] - } - */ -//}; - -//let tmp = "{" for (let i = 0; i < frontends.length; i++) { - //redirects.frontends[i] = {} - //redirects.push(frontends[i]) - //tmp = frontends[i] - //tmp = tmp + '\n"' + frontends[i] + '": {' redirects[frontends[i]] = {} for (let x = 0; x < protocols.length; x++) { - //redirects.frontends[i].protocols = [] - //tmp = tmp + '\n"' + protocols[x] + '": [],' redirects[frontends[i]][protocols[x]] = [] } - //tmp = tmp + "\n}," } -//tmp = tmp + "\n}" - -//const redirects = JSON.parse(tmp) function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects = val searxNormalRedirectsChecks = [...redirects.searx.normal] searxngNormalRedirectsChecks = [...redirects.searxng.normal] whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] librexNormalRedirectsChecks = [...redirects.librex.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = searxNormalRedirectsChecks.indexOf(instance) if (a > -1) searxNormalRedirectsChecks.splice(a, 1) @@ -499,35 +469,28 @@ function initDefaults() { .then(response => response.text()) .then(async data => { let dataJson = JSON.parse(data) - /* - redirects.searx = dataJson.searx; - redirects.searxng = dataJson.searxng; - redirects.whoogle = dataJson.whoogle; - */ for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] - searxNormalRedirectsChecks = [...redirects.searx.normal] - searxngNormalRedirectsChecks = [...redirects.searxng.normal] - librexNormalRedirectsChecks = [...redirects.librex.normal] - for (const instance of r.cloudflareBlackList) { - let i - - i = whoogleNormalRedirectsChecks.indexOf(instance) - if (i > -1) whoogleNormalRedirectsChecks.splice(i, 1) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + searxNormalRedirectsChecks = [...redirects.searx.normal] + searxngNormalRedirectsChecks = [...redirects.searxng.normal] + whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] + librexNormalRedirectsChecks = [...redirects.librex.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = searxNormalRedirectsChecks.indexOf(instance) + if (a > -1) searxNormalRedirectsChecks.splice(a, 1) - i = searxNormalRedirectsChecks.indexOf(instance) - if (i > -1) searxNormalRedirectsChecks.splice(i, 1) + const b = searxngNormalRedirectsChecks.indexOf(instance) + if (b > -1) searxngNormalRedirectsChecks.splice(b, 1) - i = searxngNormalRedirectsChecks.indexOf(instance) - if (i > -1) searxngNormalRedirectsChecks.splice(i, 1) + const c = whoogleNormalRedirectsChecks.indexOf(instance) + if (c > -1) whoogleNormalRedirectsChecks.splice(c, 1) - i = librexNormalRedirectsChecks.indexOf(instance) - if (i > -1) librexNormalRedirectsChecks.splice(i, 1) - } + const d = librexNormalRedirectsChecks.indexOf(instance) + if (d > -1) librexNormalRedirectsChecks.splice(d, 1) + } browser.storage.local.set( { disableSearch: false, @@ -535,7 +498,7 @@ function initDefaults() { searchRedirects: redirects, searxngCustomSettings: false, - whoogleNormalRedirectsChecks: whoogleNormalRedirectsChecks, + whoogleNormalRedirectsChecks, whoogleNormalCustomRedirects: [], whoogleTorRedirectsChecks: [...redirects.whoogle.tor], @@ -547,7 +510,7 @@ function initDefaults() { whoogleLokiRedirectsChecks: [...redirects.whoogle.loki], whoogleLokiCustomRedirects: [], - searxNormalRedirectsChecks: searxNormalRedirectsChecks, + searxNormalRedirectsChecks, searxNormalCustomRedirects: [], searxTorRedirectsChecks: [...redirects.searx.tor], @@ -559,7 +522,7 @@ function initDefaults() { searxLokiRedirectsChecks: [...redirects.searx.loki], searxLokiCustomRedirects: [], - searxngNormalRedirectsChecks: searxngNormalRedirectsChecks, + searxngNormalRedirectsChecks, searxngNormalCustomRedirects: [], searxngTorRedirectsChecks: [...redirects.searxng.tor], @@ -571,7 +534,7 @@ function initDefaults() { searxngLokiRedirectsChecks: [...redirects.searxng.loki], searxngLokiCustomRedirects: [], - librexNormalRedirectsChecks: librexNormalRedirectsChecks, + librexNormalRedirectsChecks, librexNormalCustomRedirects: [], librexTorRedirectsChecks: [...redirects.librex.tor], diff --git a/src/assets/javascripts/sendTargets.js b/src/assets/javascripts/sendTargets.js index ba892fe3..c9ddfe2d 100644 --- a/src/assets/javascripts/sendTargets.js +++ b/src/assets/javascripts/sendTargets.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.send = val sendNormalRedirectsChecks = [...redirects.send.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = sendNormalRedirectsChecks.indexOf(instance) if (a > -1) sendNormalRedirectsChecks.splice(a, 1) } @@ -154,18 +154,18 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - sendNormalRedirectsChecks = [...redirects.send.normal] - for (const instance of r.cloudflareBlackList) { - let i = sendNormalRedirectsChecks.indexOf(instance) - if (i > -1) sendNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + sendNormalRedirectsChecks = [...redirects.send.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = sendNormalRedirectsChecks.indexOf(instance) + if (a > -1) sendNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableSendTarget: false, sendTargetsRedirects: redirects, - sendNormalRedirectsChecks: sendNormalRedirectsChecks, + sendNormalRedirectsChecks, sendNormalCustomRedirects: [], sendTorRedirectsChecks: [...redirects.send.tor], diff --git a/src/assets/javascripts/tiktok.js b/src/assets/javascripts/tiktok.js index 9d2660d4..b7987422 100644 --- a/src/assets/javascripts/tiktok.js +++ b/src/assets/javascripts/tiktok.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.proxiTok = val proxiTokNormalRedirectsChecks = [...redirects.proxiTok.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = proxiTokNormalRedirectsChecks.indexOf(instance) if (a > -1) proxiTokNormalRedirectsChecks.splice(a, 1) } @@ -202,13 +202,20 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + proxiTokNormalRedirectsChecks = [...redirects.proxiTok.normal] + console.log(r) + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = proxiTokNormalRedirectsChecks.indexOf(instance) + if (a > -1) proxiTokNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableTiktok: false, tiktokRedirects: redirects, - proxiTokNormalRedirectsChecks: [...redirects.proxiTok.normal], + proxiTokNormalRedirectsChecks, proxiTokNormalCustomRedirects: [], proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], @@ -223,6 +230,7 @@ function initDefaults() { () => resolve() ) }) + }) }) } diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 2c500759..8da81d10 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -91,21 +91,21 @@ init() browser.storage.onChanged.addListener(init) function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects = val + simplyTranslateNormalRedirectsChecks = [...redirects.simplyTranslate.normal] lingvaNormalRedirectsChecks = [...redirects.lingva.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simplyTranslateNormalCustomRedirects.indexOf(instance) + if (a > -1) simplyTranslateNormalCustomRedirects.splice(a, 1) + const i = lingvaNormalRedirectsChecks.indexOf(instance) if (i > -1) lingvaNormalRedirectsChecks.splice(i, 1) } browser.storage.local.set({ translateRedirects: redirects, - simplyTranslateNormalRedirectsChecks: redirects.simplyTranslate.normal, - simplyTranslateTorRedirectsChecks: redirects.simplyTranslate.tor, - simplyTranslateI2pRedirectsChecks: redirects.simplyTranslate.i2p, - simplyTranslateLokiRedirectsChecks: redirects.simplyTranslate.loki, + simplyTranslateNormalRedirectsChecks, lingvaNormalRedirectsChecks, - lingvaTorRedirectsChecks: redirects.lingva.tor, }) }) } @@ -309,19 +309,24 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - lingvaNormalRedirectsChecks = [...redirects.lingva.normal] - for (const instance of r.cloudflareBlackList) { - const i = lingvaNormalRedirectsChecks.indexOf(instance) - if (i > -1) lingvaNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + simplyTranslateNormalCustomRedirects = [...redirects.simplyTranslate.normal] + lingvaNormalRedirectsChecks = [...redirects.lingva.normal] + console.log(r.offlineBlackList) + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simplyTranslateNormalCustomRedirects.indexOf(instance) + if (a > -1) simplyTranslateNormalCustomRedirects.splice(a, 1) + + const b = lingvaNormalRedirectsChecks.indexOf(instance) + if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1) + } browser.storage.local.set( { translateDisable: false, translateFrontend: "simplyTranslate", translateRedirects: redirects, - simplyTranslateNormalRedirectsChecks: [...redirects.simplyTranslate.normal], + simplyTranslateNormalRedirectsChecks, simplyTranslateNormalCustomRedirects: [], simplyTranslateTorRedirectsChecks: [...redirects.simplyTranslate.tor], @@ -333,7 +338,7 @@ function initDefaults() { simplyTranslateLokiRedirectsChecks: [...redirects.simplyTranslate.loki], simplyTranslateLokiCustomRedirects: [], - lingvaNormalRedirectsChecks: lingvaNormalRedirectsChecks, + lingvaNormalRedirectsChecks, lingvaNormalCustomRedirects: [], lingvaTorRedirectsChecks: [...redirects.lingva.tor], diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index b3c33560..83a9685d 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -17,17 +17,16 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList"], r => { + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], r => { redirects.nitter = val nitterNormalRedirectsChecks = [...redirects.nitter.normal] - for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList]) { + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { let i = nitterNormalRedirectsChecks.indexOf(instance) if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) } browser.storage.local.set({ twitterRedirects: redirects, nitterNormalRedirectsChecks, - nitterTorRedirectsChecks: [...redirects.nitter.tor], }) }) } @@ -224,19 +223,19 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList"], async r => { - nitterNormalRedirectsChecks = [...redirects.nitter.normal] - for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList]) { - let i = nitterNormalRedirectsChecks.indexOf(instance) - if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { + nitterNormalRedirectsChecks = [...redirects.nitter.normal] + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { + let i = nitterNormalRedirectsChecks.indexOf(instance) + if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) + } browser.storage.local.set( { disableTwitter: false, twitterRedirects: redirects, twitterRedirectType: "both", - nitterNormalRedirectsChecks: nitterNormalRedirectsChecks, + nitterNormalRedirectsChecks, nitterNormalCustomRedirects: [], nitterTorRedirectsChecks: [...redirects.nitter.tor], @@ -251,7 +250,7 @@ function initDefaults() { () => resolve() ) }) - }) +}) }) } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index d881eba1..c6cecc05 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -25,7 +25,7 @@ function getRandomInstance(instances) { let cloudflareBlackList = [] let authenticateBlackList = [] -let offlineBlacklist = [] +let offlineBlackList = [] async function initBlackList() { return new Promise(resolve => { fetch("/instances/blacklist.json") @@ -33,7 +33,7 @@ async function initBlackList() { .then(data => { cloudflareBlackList = JSON.parse(data).cloudflare authenticateBlackList = JSON.parse(data).authenticate - offlineBlacklist = JSON.parse(data).offlineBlacklist + offlineBlackList = JSON.parse(data).offline resolve() }) }) @@ -62,6 +62,7 @@ function updateInstances() { invidious: instances.invidious, piped: instances.piped, pipedMaterial: instances.pipedMaterial, + cloudtube: instances.cloudtube }) twitterHelper.setRedirects(instances.nitter) instagramHelper.setRedirects(instances.bibliogram) @@ -164,7 +165,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) { ...redirects[name][protocol].map(x => { const cloudflare = cloudflareBlackList.includes(x) ? ' cloudflare' : "" const authenticate = authenticateBlackList.includes(x) ? ' authenticate' : "" - const offline = offlineBlacklist.includes(x) ? ' offline' : "" + const offline = offlineBlackList.includes(x) ? ' offline' : "" let ms = instancesLatency[x] let latencyColor = ms <= 1000 ? "green" : ms <= 2000 ? "orange" : "red" @@ -285,30 +286,22 @@ function pingOnce(href) { resolve(5000 + http.status) } } - } http.open("GET", `${href}?_=${new Date().getTime()}`, true) started = new Date().getTime() http.send(null) }) } - async function testLatency(element, instances, frontend) { return new Promise(async resolve => { let myList = {} let latencyThreshold let redirectsChecks = [] - browser.storage.local.get( - [ - "latencyThreshold", - `${frontend}NormalRedirectsChecks` - ], - r => { - latencyThreshold = r.latencyThreshold - redirectsChecks = r[`${frontend}NormalRedirectsChecks`] - } - ) + browser.storage.local.get(["latencyThreshold", `${frontend}NormalRedirectsChecks`], r => { + latencyThreshold = r.latencyThreshold + redirectsChecks = r[`${frontend}NormalRedirectsChecks`] + }) for (const href of instances) await ping(href).then(time => { if (time) { diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index 04191d1a..cecb3189 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -17,10 +17,10 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects.wikiless = val wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = wikilessNormalRedirectsChecks.indexOf(instance) if (a > -1) wikilessNormalRedirectsChecks.splice(a, 1) } @@ -200,18 +200,18 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] - for (const instance of r.cloudflareBlackList) { - let i = wikilessNormalRedirectsChecks.indexOf(instance) - if (i > -1) wikilessNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = wikilessNormalRedirectsChecks.indexOf(instance) + if (a > -1) wikilessNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableWikipedia: true, wikipediaRedirects: redirects, - wikilessNormalRedirectsChecks: wikilessNormalRedirectsChecks, + wikilessNormalRedirectsChecks, wikilessNormalCustomRedirects: [], wikilessTorRedirectsChecks: [...redirects.wikiless.tor], diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index 7e02dcd2..63e58d5b 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -30,14 +30,13 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { - for (let i = 0; i < frontends.length; i++) { - redirects.frontends = val.frontends - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects = val invidiousNormalRedirectsChecks = [...redirects.invidious.normal] pipedNormalRedirectsChecks = [...redirects.piped.normal] pipedMaterialNormalRedirectsChecks = [...redirects.pipedMaterial.normal] - for (const instance of r.cloudflareBlackList) { + cloudtubeNormalRedirectsChecks = [...redirects.cloudtube.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = invidiousNormalRedirectsChecks.indexOf(instance) if (a > -1) invidiousNormalRedirectsChecks.splice(a, 1) @@ -450,13 +449,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { invidiousNormalRedirectsChecks = [...redirects.invidious.normal] pipedNormalRedirectsChecks = [...redirects.piped.normal] pipedMaterialNormalRedirectsChecks = [...redirects.pipedMaterial.normal] cloudtubeNormalRedirectsChecks = [...redirects.cloudtube.normal] - - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = invidiousNormalRedirectsChecks.indexOf(instance) if (a > -1) invidiousNormalRedirectsChecks.splice(a, 1) @@ -467,9 +465,8 @@ function initDefaults() { if (c > -1) pipedMaterialNormalRedirectsChecks.splice(c, 1) const d = cloudtubeNormalRedirectsChecks.indexOf(instance) - if (d > -1) cloudtubeNormalRedirectsChecks.indexOf(instance) + if (c > -1) cloudtubeNormalRedirectsChecks.splice(d, 1) } - browser.storage.local.set( { disableYoutube: false, @@ -478,7 +475,7 @@ function initDefaults() { youtubeRedirects: redirects, youtubeFrontend: "invidious", - invidiousNormalRedirectsChecks: invidiousNormalRedirectsChecks, + invidiousNormalRedirectsChecks, invidiousNormalCustomRedirects: [], invidiousTorRedirectsChecks: [...redirects.invidious.tor], @@ -490,7 +487,7 @@ function initDefaults() { invidiousLokiRedirectsChecks: [...redirects.invidious.loki], invidiousLokiCustomRedirects: [], - pipedNormalRedirectsChecks: pipedNormalRedirectsChecks, + pipedNormalRedirectsChecks, pipedNormalCustomRedirects: [], pipedTorRedirectsChecks: [...redirects.piped.tor], diff --git a/src/assets/javascripts/youtubeMusic.js b/src/assets/javascripts/youtubeMusic.js index 3ff9a174..753ce7ad 100644 --- a/src/assets/javascripts/youtubeMusic.js +++ b/src/assets/javascripts/youtubeMusic.js @@ -19,11 +19,11 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get("cloudflareBlackList", r => { + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { redirects = val beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] - for (const instance of r.cloudflareBlackList) { + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { const a = beatbumpNormalRedirectsChecks.indexOf(instance) if (a > -1) beatbumpNormalRedirectsChecks.splice(a, 1) @@ -266,25 +266,23 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get("cloudflareBlackList", async r => { - beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] - hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] - for (const instance of r.cloudflareBlackList) { - let i - - i = beatbumpNormalRedirectsChecks.indexOf(instance) - if (i > -1) beatbumpNormalRedirectsChecks.splice(i, 1) - - i = hyperpipeNormalRedirectsChecks.indexOf(instance) - if (i > -1) hyperpipeNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] + hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = beatbumpNormalRedirectsChecks.indexOf(instance) + if (a > -1) beatbumpNormalRedirectsChecks.splice(a, 1) + + const b = hyperpipeNormalRedirectsChecks.indexOf(instance) + if (b > -1) hyperpipeNormalRedirectsChecks.splice(b, 1) + } browser.storage.local.set( { disableYoutubeMusic: false, youtubeMusicFrontend: "hyperpipe", youtubeMusicRedirects: redirects, - beatbumpNormalRedirectsChecks: beatbumpNormalRedirectsChecks, + beatbumpNormalRedirectsChecks, beatbumpNormalCustomRedirects: [], beatbumpTorRedirectsChecks: [...redirects.beatbump.tor], @@ -296,7 +294,7 @@ function initDefaults() { beatbumpLokiRedirectsChecks: [...redirects.beatbump.loki], beatbumpLokiCustomRedirects: [], - hyperpipeNormalRedirectsChecks: hyperpipeNormalRedirectsChecks, + hyperpipeNormalRedirectsChecks, hyperpipeNormalCustomRedirects: [], hyperpipeTorRedirectsChecks: [...redirects.hyperpipe.tor], diff --git a/src/pages/background/background.js b/src/pages/background/background.js index a1b0c9c6..c6e9ab7a 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -32,25 +32,27 @@ browser.runtime.onInstalled.addListener(details => { browser.storage.local.clear(() => { browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, () => { - generalHelper.initDefaults() - youtubeHelper.initDefaults() - youtubeMusicHelper.initDefaults() - twitterHelper.initDefaults() - instagramHelper.initDefaults() - mapsHelper.initDefaults() - searchHelper.initDefaults() - translateHelper.initDefaults() - mediumHelper.initDefaults() - quoraHelper.initDefaults() - libremdbHelper.initDefaults() - reutersHelper.initDefaults() - redditHelper.initDefaults() - wikipediaHelper.initDefaults() - imgurHelper.initDefaults() - tiktokHelper.initDefaults() - sendTargetsHelper.initDefaults() - peertubeHelper.initDefaults() - lbryHelper.initDefaults() + browser.storage.local.set({ offlineBlackList: JSON.parse(data).offline }, () => { + generalHelper.initDefaults() + youtubeHelper.initDefaults() + youtubeMusicHelper.initDefaults() + twitterHelper.initDefaults() + instagramHelper.initDefaults() + mapsHelper.initDefaults() + searchHelper.initDefaults() + translateHelper.initDefaults() + mediumHelper.initDefaults() + quoraHelper.initDefaults() + libremdbHelper.initDefaults() + reutersHelper.initDefaults() + redditHelper.initDefaults() + wikipediaHelper.initDefaults() + imgurHelper.initDefaults() + tiktokHelper.initDefaults() + sendTargetsHelper.initDefaults() + peertubeHelper.initDefaults() + lbryHelper.initDefaults() + }) }) }) }) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index afad0bf9..077b3da2 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -3186,4 +3186,4 @@
- \ No newline at end of file + diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index c64eb25d..4ef30cec 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -81,6 +81,7 @@ resetSettings.addEventListener("click", async () => { .then(response => response.text()) .then(async data => { browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { + browser.storage.local.set({ offlineBlackList: JSON.parse(data).offline }, () => { browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, async () => { await generalHelper.initDefaults() await youtubeHelper.initDefaults() @@ -103,6 +104,7 @@ resetSettings.addEventListener("click", async () => { await lbryHelper.initDefaults() location.reload() }) + }) }) }) }) -- cgit 1.4.1 From 3f87eb032c5a48ff84445f69633a9a55fcc27bbc Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 22:30:21 +0100 Subject: Make lists sensable --- src/instances/blacklist.json | 4 +-- src/instances/data.json | 58 +++--------------------------------------- src/instances/get_instances.py | 2 +- 3 files changed, 6 insertions(+), 58 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 77aec738..e7756f8e 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -6,7 +6,6 @@ "https://piped.moomoo.me", "https://piped.mha.fi", "https://de-piped.shimul.me", - "https://jp-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", @@ -68,7 +67,6 @@ "https://jsearch.pw", "https://searx.gnu.style", "https://searx.semipvt.com", - "https://searx.vanwa.tech", "https://etsi.me", "https://s.zhaocloud.net", "https://search.vidhukant.xyz", @@ -81,4 +79,4 @@ "https://beatbump.ml", "https://stube.tokhmi.xyz" ] -} +} \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index 76c9f6d3..3e82842c 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -3,13 +3,6 @@ "normal": [ "https://yewtu.be", "https://vid.puffyan.us", -<<<<<<< HEAD -<<<<<<< HEAD -======= - "https://invidious.snopyta.org", ->>>>>>> 0b6c717 (update instances) -======= ->>>>>>> origin/master "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", @@ -19,29 +12,16 @@ "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", "https://inv.bp.projectsegfau.lt", + "https://invidious.projectsegfau.lt", "https://inv.vern.cc", "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", -<<<<<<< HEAD -<<<<<<< HEAD - "https://youtube.076.ne.jp", - "https://invidious.weblibre.org", - "https://invidious.snopyta.org", -======= "https://youtube.076.ne.jp", "https://invidious.weblibre.org", "https://invidious.snopyta.org", - "https://invidious.projectsegfau.lt", ->>>>>>> origin/master "https://invidious.esmailelbob.xyz", "https://invidious.namazso.eu" -======= - "https://invidious.weblibre.org", - "https://youtube.076.ne.jp", - "https://invidious.namazso.eu", - "https://invidious.esmailelbob.xyz" ->>>>>>> 0b6c717 (update instances) ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -64,23 +44,12 @@ "https://piped.moomoo.me", "https://il.ax", "https://piped.mha.fi", -<<<<<<< HEAD "https://de-piped.shimul.me", -======= - "https://jp-piped.shimul.me", ->>>>>>> origin/master "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", -<<<<<<< HEAD -<<<<<<< HEAD -======= "https://piped.mint.lgbt", - "https://piped.privacy.com.de", ->>>>>>> 0b6c717 (update instances) -======= ->>>>>>> origin/master "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], @@ -515,7 +484,6 @@ "https://searx.bissisoft.com", "https://searx.divided-by-zero.eu", "https://searx.dresden.network", - "https://searx.ebnar.xyz", "https://searx.fossencdi.org", "https://searx.gnu.style", "https://searx.mastodontech.de", @@ -533,7 +501,6 @@ "https://searx.tuxcloud.net", "https://searx.tyil.nl", "https://searx.vanwa.tech", - "https://searx.vimproved.me", "https://searx.webheberg.info", "https://searx.xyz", "https://searx.zapashcanon.fr", @@ -551,17 +518,7 @@ "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", -<<<<<<< HEAD -<<<<<<< HEAD "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" -======= - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx" ->>>>>>> 0b6c717 (update instances) -======= - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ->>>>>>> origin/master ], "i2p": [ "http://ransack.i2p", @@ -606,6 +563,7 @@ "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", + "https://searx.ebnar.xyz", "https://searx.ericaftereric.top", "https://searx.esmailelbob.xyz", "https://searx.fi", @@ -622,10 +580,7 @@ "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", -<<<<<<< HEAD "https://searx.vimproved.me", -======= ->>>>>>> origin/master "https://searx.zcyph.cc", "https://searxng.au/searx", "https://searxng.tordenskjold.de", @@ -647,8 +602,10 @@ "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", + "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" ], @@ -776,14 +733,7 @@ "loki": [] }, "peertube": [ -<<<<<<< HEAD -<<<<<<< HEAD - "https://tube.nogafa.org", -======= ->>>>>>> 0b6c717 (update instances) -======= "https://tube.nogafa.org", ->>>>>>> origin/master "https://www.neptube.io", "https://tube.ghk-academy.info", "https://pcbu.nl", diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 07adbceb..eab4a924 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -92,7 +92,7 @@ def is_authenticate(url): def is_offline(url): try: r = requests.get(url, timeout=5) - if r.status_code != 200: + if r.status_code >= 400: print(url + ' is ' + Fore.RED + 'offline' + Style.RESET_ALL) print("Status code") print(r.status_code) -- cgit 1.4.1 From f7fbe4a912c8caa4d1c41e642379f4cebfdcf05f Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 22:46:31 +0100 Subject: Make fetching non-normal instances actually work --- src/assets/javascripts/imdb.js | 3 +++ src/assets/javascripts/imgur.js | 3 +++ src/assets/javascripts/instagram.js | 3 +++ src/assets/javascripts/lbry.js | 3 +++ src/assets/javascripts/maps.js | 3 +++ src/assets/javascripts/medium.js | 3 +++ src/assets/javascripts/peertube.js | 3 +++ src/assets/javascripts/quora.js | 3 +++ src/assets/javascripts/reddit.js | 6 ++++++ src/assets/javascripts/reuters.js | 3 +++ src/assets/javascripts/search.js | 12 ++++++++++++ src/assets/javascripts/sendTargets.js | 3 +++ src/assets/javascripts/tiktok.js | 3 +++ src/assets/javascripts/translate/translate.js | 6 ++++++ src/assets/javascripts/twitter.js | 3 +++ src/assets/javascripts/wikipedia.js | 3 +++ src/assets/javascripts/youtube/youtube.js | 12 ++++++++++++ src/assets/javascripts/youtubeMusic.js | 6 ++++++ 18 files changed, 81 insertions(+) diff --git a/src/assets/javascripts/imdb.js b/src/assets/javascripts/imdb.js index 1f6c7a5f..9b235280 100644 --- a/src/assets/javascripts/imdb.js +++ b/src/assets/javascripts/imdb.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ imdbRedirects: redirects, libremdbNormalRedirectsChecks, + libremdbTorRedirectsChecks: [...redirects.libremdb.tor], + libremdbI2pRedirectsChecks: [...redirects.libremdb.i2p], + libremdbLokiRedirectsChecks: [...redirects.libremdb.loki] }) }) } diff --git a/src/assets/javascripts/imgur.js b/src/assets/javascripts/imgur.js index 25f61f06..6b943845 100644 --- a/src/assets/javascripts/imgur.js +++ b/src/assets/javascripts/imgur.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ imgurRedirects: redirects, rimgoNormalRedirectsChecks, + rimgoTorRedirectsChecks: [...redirects.rimgo.tor], + rimgoI2pRedirectsChecks: [...redirects.rimgo.i2p], + rimgoLokiRedirectsChecks: [...redirects.rimgo.loki] }) }) } diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index a65dac80..4908f5a3 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -26,6 +26,9 @@ function setRedirects(val) { browser.storage.local.set({ instagramRedirects: redirects, bibliogramNormalRedirectsChecks, + bibliogramTorRedirectsChecks: [...redirects.bibliogram.tor], + bibliogramI2pRedirectsChecks: [...redirects.bibliogram.i2p], + bibliogramLokiRedirectsChecks: [...redirects.bibliogram.loki] }) }) } diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index b1e6f477..6ca058eb 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ lbryTargetsRedirects: redirects, librarianNormalRedirectsChecks, + librarianTorRedirectsChecks: [...redirects.librarian.tor], + librarianI2pRedirectsChecks: [...redirects.librarian.i2p], + librarianLokiRedirectsChecks: [...redirects.librarian.loki] }) }) } diff --git a/src/assets/javascripts/maps.js b/src/assets/javascripts/maps.js index 6627faff..79fd7a66 100644 --- a/src/assets/javascripts/maps.js +++ b/src/assets/javascripts/maps.js @@ -31,6 +31,9 @@ function setRedirects(val) { browser.storage.local.set({ mapsRedirects: redirects, facilNormalRedirectsChecks, + facilTorRedirectsChecks: [...redirects.facil.tor], + facilI2pRedirectsChecks: [...redirects.facil.i2p], + facilLokiRedirectsChecks: [...redirects.facil.loki] }) }) } diff --git a/src/assets/javascripts/medium.js b/src/assets/javascripts/medium.js index f1dcf2e2..2d63eb4d 100644 --- a/src/assets/javascripts/medium.js +++ b/src/assets/javascripts/medium.js @@ -50,6 +50,9 @@ function setRedirects(val) { browser.storage.local.set({ mediumRedirects: redirects, scribeNormalRedirectsChecks, + scribeTorRedirectsChecks: [...redirects.scribe.tor], + scribeI2pRedirectsChecks: [...redirects.scribe.i2p], + scribeLokiRedirectsChecks: [...redirects.scribe.loki] }) }) } diff --git a/src/assets/javascripts/peertube.js b/src/assets/javascripts/peertube.js index df95611c..9819c01a 100644 --- a/src/assets/javascripts/peertube.js +++ b/src/assets/javascripts/peertube.js @@ -25,6 +25,9 @@ function setRedirects(val) { browser.storage.local.set({ peertubeRedirects: redirects, simpleertubeNormalRedirectsChecks, + simpleertubeTorRedirectsChecks: [...redirects.simpleertube.tor], + simpleertubeI2pRedirectsChecks: [...redirects.simpleertube.i2p], + simpleertubeLokiRedirectsChecks: [...redirects.simpleertube.loki] }) }) } diff --git a/src/assets/javascripts/quora.js b/src/assets/javascripts/quora.js index 4d8249f8..e2412135 100644 --- a/src/assets/javascripts/quora.js +++ b/src/assets/javascripts/quora.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ quoraRedirects: redirects, quetreNormalRedirectsChecks, + quetreTorRedirectsChecks: [...redirects.quetre.tor], + quetreI2pRedirectsChecks: [...redirects.quetre.i2p], + quetreLokiRedirectsChecks: [...redirects.quetre.loki] }) }) } diff --git a/src/assets/javascripts/reddit.js b/src/assets/javascripts/reddit.js index 2a07dffb..0d324e9e 100644 --- a/src/assets/javascripts/reddit.js +++ b/src/assets/javascripts/reddit.js @@ -30,7 +30,13 @@ function setRedirects(val) { browser.storage.local.set({ redditRedirects: redirects, libredditNormalRedirectsChecks, + libredditTorRedirectsChecks: [...redirects.libreddit.tor], + libredditI2pRedirectsChecks: [...redirects.libreddit.i2p], + libredditLokiRedirectsChecks: [...redirects.libreddit.loki], tedditNormalRedirectsChecks, + tedditTorRedirectsChecks: [...redirects.teddit.tor], + tedditI2pRedirectsChecks: [...redirects.teddit.i2p], + tedditLokiRedirectsChecks: [...redirects.teddit.loki] }) }) } diff --git a/src/assets/javascripts/reuters.js b/src/assets/javascripts/reuters.js index 78f5077b..d1a0710b 100644 --- a/src/assets/javascripts/reuters.js +++ b/src/assets/javascripts/reuters.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ neutersRedirects: redirects, neutersNormalRedirectsChecks, + neutersTorRedirectsChecks: [...redirects.neuters.tor], + neutersI2pRedirectsChecks: [...redirects.neuters.i2p], + neutersLokiRedirectsChecks: [...redirects.neuters.loki] }) }) } diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index 04b5b8d4..7a137eaf 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -39,9 +39,21 @@ function setRedirects(val) { browser.storage.local.set({ searchRedirects: redirects, searxNormalRedirectsChecks, + searxTorRedirectsChecks: [...redirects.searx.tor], + searxI2pRedirectsChecks: [...redirects.searx.i2p], + searxLokiRedirectsChecks: [...redirects.searx.loki], searxngNormalRedirectsChecks, + searxngTorRedirectsChecks: [...redirects.searxng.tor], + searxngI2pRedirectsChecks: [...redirects.searxng.i2p], + searxngLokiRedirectsChecks: [...redirects.searxng.loki], whoogleNormalRedirectsChecks, + whoogleTorRedirectsChecks: [...redirects.whoogle.tor], + whoogleI2pRedirectsChecks: [...redirects.whoogle.i2p], + whoogleLokiRedirectsChecks: [...redirects.whoogle.loki], librexNormalRedirectsChecks, + librexTorRedirectsChecks: [...redirects.librex.tor], + librexI2pRedirectsChecks: [...redirects.librex.i2p], + librexLokiRedirectsChecks: [...redirects.librex.loki] }) }) } diff --git a/src/assets/javascripts/sendTargets.js b/src/assets/javascripts/sendTargets.js index c9ddfe2d..d17e969d 100644 --- a/src/assets/javascripts/sendTargets.js +++ b/src/assets/javascripts/sendTargets.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ sendTargetsRedirects: redirects, sendNormalRedirectsChecks, + sendTorRedirectsChecks: [...redirects.send.tor], + sendI2pRedirectsChecks: [...redirects.send.i2p], + sendLokiRedirectsChecks: [...redirects.send.loki] }) }) } diff --git a/src/assets/javascripts/tiktok.js b/src/assets/javascripts/tiktok.js index b7987422..924aa81f 100644 --- a/src/assets/javascripts/tiktok.js +++ b/src/assets/javascripts/tiktok.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ tiktokRedirects: redirects, proxiTokNormalRedirectsChecks, + proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], + proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p], + proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki] }) }) } diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 8da81d10..2e55c61b 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -105,7 +105,13 @@ function setRedirects(val) { browser.storage.local.set({ translateRedirects: redirects, simplyTranslateNormalRedirectsChecks, + simplyTranslateTorRedirectsChecks: [...redirects.simplyTranslate.tor], + simplyTranslateI2pRedirectsChecks: [...redirects.simplyTranslate.i2p], + simplyTranslateLokiRedirectsChecks: [...redirects.simplyTranslate.loki], lingvaNormalRedirectsChecks, + lingvaTorRedirectsChecks: [...redirects.lingva.tor], + lingvaI2pRedirectsChecks: [...redirects.lingva.i2p], + lingvaLokiRedirectsChecks: [...redirects.lingva.loki] }) }) } diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 83a9685d..8131fbc2 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ twitterRedirects: redirects, nitterNormalRedirectsChecks, + nitterTorRedirectsChecks: [...redirects.nitter.tor], + nitterI2pRedirectsChecks: [...redirects.nitter.i2p], + nitterLokiRedirectsChecks: [...redirects.nitter.loki] }) }) } diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index cecb3189..c72cb804 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -27,6 +27,9 @@ function setRedirects(val) { browser.storage.local.set({ wikipediaRedirects: redirects, wikilessNormalRedirectsChecks, + wikilessTorRedirectsChecks: [...redirects.wikiless.tor], + wikilessI2pRedirectsChecks: [...redirects.wikiless.i2p], + wikilessLokiRedirectsChecks: [...redirects.wikiless.loki] }) }) } diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index 63e58d5b..b08ff909 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -52,9 +52,21 @@ function setRedirects(val) { browser.storage.local.set({ youtubeRedirects: redirects, invidiousNormalRedirectsChecks, + invidiousTorRedirectsChecks: [...redirects.invidious.tor], + invidiousI2pRedirectsChecks: [...redirects.invidious.i2p], + invidiousLokiRedirectsChecks: [...redirects.invidious.loki], pipedNormalRedirectsChecks, + pipedTorRedirectsChecks: [...redirects.piped.tor], + pipedI2pRedirectsChecks: [...redirects.piped.i2p], + pipedLokiRedirectsChecks: [...redirects.piped.loki], pipedMaterialNormalRedirectsChecks, + pipedMaterialTorRedirectsChecks: [...redirects.pipedMaterial.tor], + pipedMaterialI2pRedirectsChecks: [...redirects.pipedMaterial.i2p], + pipedMaterialLokiRedirectsChecks: [...redirects.pipedMaterial.loki], cloudtubeNormalRedirectsChecks, + cloudtubeTorRedirectsChecks: [...redirects.cloudtube.tor], + cloudtubeI2pRedirectsChecks: [...redirects.cloudtube.i2p], + cloudtubeLokiRedirectsChecks: [...redirects.cloudtube.loki] }) }) } diff --git a/src/assets/javascripts/youtubeMusic.js b/src/assets/javascripts/youtubeMusic.js index 753ce7ad..f0b44e1f 100644 --- a/src/assets/javascripts/youtubeMusic.js +++ b/src/assets/javascripts/youtubeMusic.js @@ -33,7 +33,13 @@ function setRedirects(val) { browser.storage.local.set({ youtubeMusicRedirects: redirects, beatbumpNormalRedirectsChecks, + beatbumpTorRedirectsChecks: [...redirects.beatbump.tor], + beatbumpI2pRedirectsChecks: [...redirects.beatbump.i2p], + beatbumpLokiRedirectsChecks: [...redirects.beatbump.loki], hyperpipeNormalRedirectsChecks, + hyperpipeTorRedirectsChecks: [...redirects.hyperpipe.tor], + hyperpipeI2pRedirectsChecks: [...redirects.hyperpipe.i2p], + hyperpipeLokiRedirectsChecks: [...redirects.hyperpipe.loki] }) }) } -- cgit 1.4.1 From b1ebf0e2de7fdc72ad6b072c75cec48ce7fc89ab Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 22:52:57 +0100 Subject: Uncomment --- src/pages/options/widgets/general.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 4ef30cec..d6824251 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -134,14 +134,14 @@ protocolFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ protocolFallback: event.target.checked }) }) -// let latencyOutput = document.getElementById("latency-output") -// let latencyInput = document.getElementById("latency-input") -// latencyInput.addEventListener("change", event => { -// browser.storage.local.set({ latencyThreshold: event.target.value }) -// }) -// latencyInput.addEventListener("input", event => { -// latencyOutput.value = event.target.value -// }) +let latencyOutput = document.getElementById("latency-output") +let latencyInput = document.getElementById("latency-input") +latencyInput.addEventListener("change", event => { + browser.storage.local.set({ latencyThreshold: event.target.value }) +}) +latencyInput.addEventListener("input", event => { + latencyOutput.value = event.target.value +}) let nameCustomInstanceInput = document.getElementById("exceptions-custom-instance") let instanceTypeElement = document.getElementById("exceptions-custom-instance-type") @@ -176,7 +176,7 @@ browser.storage.local.get( themeElement.value = r.theme protocolElement.value = r.protocol protocolFallbackCheckbox.checked = r.protocolFallback - // latencyOutput.value = r.latencyThreshold + latencyOutput.value = r.latencyThreshold // firstPartyIsolate.checked = r.firstPartyIsolate; let protocolFallbackElement = document.getElementById("protocol-fallback") -- cgit 1.4.1 From 9959aeb4eaef177e77c00328fb9be72c33c17872 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 23:04:04 +0100 Subject: Fix simplytranslate and make things prettier --- src/assets/javascripts/general.js | 2 +- src/assets/javascripts/imdb.js | 54 ++++++++++++------------- src/assets/javascripts/imgur.js | 14 +++---- src/assets/javascripts/instagram.js | 14 +++---- src/assets/javascripts/lbry.js | 58 +++++++++++++-------------- src/assets/javascripts/maps.js | 54 ++++++++++++------------- src/assets/javascripts/medium.js | 14 +++---- src/assets/javascripts/peertube.js | 14 +++---- src/assets/javascripts/quora.js | 56 +++++++++++++------------- src/assets/javascripts/reddit.js | 22 +++++----- src/assets/javascripts/reuters.js | 56 +++++++++++++------------- src/assets/javascripts/search.js | 32 +++++++-------- src/assets/javascripts/sendTargets.js | 14 +++---- src/assets/javascripts/tiktok.js | 57 +++++++++++++------------- src/assets/javascripts/translate/translate.js | 29 +++++++------- src/assets/javascripts/twitter.js | 16 ++++---- src/assets/javascripts/utils.js | 2 +- src/assets/javascripts/wikipedia.js | 14 +++---- src/assets/javascripts/youtube/youtube.js | 4 +- src/assets/javascripts/youtubeMusic.js | 22 +++++----- 20 files changed, 273 insertions(+), 275 deletions(-) diff --git a/src/assets/javascripts/general.js b/src/assets/javascripts/general.js index 113dc6f7..a8360bd5 100644 --- a/src/assets/javascripts/general.js +++ b/src/assets/javascripts/general.js @@ -32,7 +32,7 @@ async function initDefaults() { firstPartyIsolate: false, protocol: "normal", protocolFallback: true, - latencyThreshold: 1000 + latencyThreshold: 1000, }, () => resolve() ) diff --git a/src/assets/javascripts/imdb.js b/src/assets/javascripts/imdb.js index 9b235280..57368557 100644 --- a/src/assets/javascripts/imdb.js +++ b/src/assets/javascripts/imdb.js @@ -29,7 +29,7 @@ function setRedirects(val) { libremdbNormalRedirectsChecks, libremdbTorRedirectsChecks: [...redirects.libremdb.tor], libremdbI2pRedirectsChecks: [...redirects.libremdb.i2p], - libremdbLokiRedirectsChecks: [...redirects.libremdb.loki] + libremdbLokiRedirectsChecks: [...redirects.libremdb.loki], }) }) } @@ -175,32 +175,32 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - libremdbNormalRedirectsChecks = [...redirects.libremdb.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = libremdbNormalRedirectsChecks.indexOf(instance) - if (a > -1) libremdbNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set( - { - disableImdb: true, - imdbRedirects: redirects, - - libremdbNormalRedirectsChecks, - libremdbNormalCustomRedirects: [], - - libremdbTorRedirectsChecks: [...redirects.libremdb.tor], - libremdbTorCustomRedirects: [], - - libremdbI2pRedirectsChecks: [], - libremdbI2pCustomRedirects: [], - - libremdbLokiRedirectsChecks: [], - libremdbLokiCustomRedirects: [], - }, - () => resolve() - ) - }) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + libremdbNormalRedirectsChecks = [...redirects.libremdb.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = libremdbNormalRedirectsChecks.indexOf(instance) + if (a > -1) libremdbNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + disableImdb: true, + imdbRedirects: redirects, + + libremdbNormalRedirectsChecks, + libremdbNormalCustomRedirects: [], + + libremdbTorRedirectsChecks: [...redirects.libremdb.tor], + libremdbTorCustomRedirects: [], + + libremdbI2pRedirectsChecks: [], + libremdbI2pCustomRedirects: [], + + libremdbLokiRedirectsChecks: [], + libremdbLokiCustomRedirects: [], + }, + () => resolve() + ) + }) }) }) } diff --git a/src/assets/javascripts/imgur.js b/src/assets/javascripts/imgur.js index 6b943845..15b9ccac 100644 --- a/src/assets/javascripts/imgur.js +++ b/src/assets/javascripts/imgur.js @@ -29,7 +29,7 @@ function setRedirects(val) { rimgoNormalRedirectsChecks, rimgoTorRedirectsChecks: [...redirects.rimgo.tor], rimgoI2pRedirectsChecks: [...redirects.rimgo.i2p], - rimgoLokiRedirectsChecks: [...redirects.rimgo.loki] + rimgoLokiRedirectsChecks: [...redirects.rimgo.loki], }) }) } @@ -177,12 +177,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = rimgoNormalRedirectsChecks.indexOf(instance) - if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = rimgoNormalRedirectsChecks.indexOf(instance) + if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableImgur: false, diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index 4908f5a3..d0aa07c0 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -28,7 +28,7 @@ function setRedirects(val) { bibliogramNormalRedirectsChecks, bibliogramTorRedirectsChecks: [...redirects.bibliogram.tor], bibliogramI2pRedirectsChecks: [...redirects.bibliogram.i2p], - bibliogramLokiRedirectsChecks: [...redirects.bibliogram.loki] + bibliogramLokiRedirectsChecks: [...redirects.bibliogram.loki], }) }) } @@ -206,12 +206,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = bibliogramNormalRedirectsChecks.indexOf(instance) - if (a > -1) bibliogramNormalRedirectsChecks.splice(a, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = bibliogramNormalRedirectsChecks.indexOf(instance) + if (a > -1) bibliogramNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set({ disableInstagram: false, instagramRedirects: redirects, diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index 6ca058eb..5e285ada 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -29,7 +29,7 @@ function setRedirects(val) { librarianNormalRedirectsChecks, librarianTorRedirectsChecks: [...redirects.librarian.tor], librarianI2pRedirectsChecks: [...redirects.librarian.i2p], - librarianLokiRedirectsChecks: [...redirects.librarian.loki] + librarianLokiRedirectsChecks: [...redirects.librarian.loki], }) }) } @@ -178,34 +178,34 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - librarianNormalRedirectsChecks = [...redirects.librarian.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = librarianNormalRedirectsChecks.indexOf(instance) - if (a > -1) librarianNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set( - { - disableLbryTargets: true, - lbryFrontend: "librarian", - lbryTargetsRedirects: redirects, - lbryRedirectType: "both", - - librarianNormalRedirectsChecks, - librarianNormalCustomRedirects: [], - - librarianTorRedirectsChecks: [...redirects.librarian.tor], - librarianTorCustomRedirects: [], - - librarianI2pRedirectsChecks: [...redirects.librarian.i2p], - librarianI2pCustomRedirects: [], - - librarianLokiRedirectsChecks: [...redirects.librarian.loki], - librarianLokiCustomRedirects: [], - }, - () => resolve() - ) - }) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + librarianNormalRedirectsChecks = [...redirects.librarian.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = librarianNormalRedirectsChecks.indexOf(instance) + if (a > -1) librarianNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + disableLbryTargets: true, + lbryFrontend: "librarian", + lbryTargetsRedirects: redirects, + lbryRedirectType: "both", + + librarianNormalRedirectsChecks, + librarianNormalCustomRedirects: [], + + librarianTorRedirectsChecks: [...redirects.librarian.tor], + librarianTorCustomRedirects: [], + + librarianI2pRedirectsChecks: [...redirects.librarian.i2p], + librarianI2pCustomRedirects: [], + + librarianLokiRedirectsChecks: [...redirects.librarian.loki], + librarianLokiCustomRedirects: [], + }, + () => resolve() + ) + }) }) }) } diff --git a/src/assets/javascripts/maps.js b/src/assets/javascripts/maps.js index 79fd7a66..6e3c9af0 100644 --- a/src/assets/javascripts/maps.js +++ b/src/assets/javascripts/maps.js @@ -33,7 +33,7 @@ function setRedirects(val) { facilNormalRedirectsChecks, facilTorRedirectsChecks: [...redirects.facil.tor], facilI2pRedirectsChecks: [...redirects.facil.i2p], - facilLokiRedirectsChecks: [...redirects.facil.loki] + facilLokiRedirectsChecks: [...redirects.facil.loki], }) }) } @@ -267,32 +267,32 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - facilNormalRedirectsChecks = [...redirects.facil.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = facilNormalRedirectsChecks.indexOf(instance) - if (a > -1) facilNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set( - { - disableMaps: false, - mapsFrontend: "osm", - mapsRedirects: redirects, - facilNormalRedirectsChecks, - facilNormalCustomRedirects: [], - - facilTorRedirectsChecks: [...redirects.facil.tor], - facilTorCustomRedirects: [], - - facilI2pRedirectsChecks: [...redirects.facil.i2p], - facilI2pCustomRedirects: [], - - facilLokiRedirectsChecks: [...redirects.facil.loki], - facilLokiCustomRedirects: [], - }, - () => resolve() - ) - }) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + facilNormalRedirectsChecks = [...redirects.facil.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = facilNormalRedirectsChecks.indexOf(instance) + if (a > -1) facilNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + disableMaps: false, + mapsFrontend: "osm", + mapsRedirects: redirects, + facilNormalRedirectsChecks, + facilNormalCustomRedirects: [], + + facilTorRedirectsChecks: [...redirects.facil.tor], + facilTorCustomRedirects: [], + + facilI2pRedirectsChecks: [...redirects.facil.i2p], + facilI2pCustomRedirects: [], + + facilLokiRedirectsChecks: [...redirects.facil.loki], + facilLokiCustomRedirects: [], + }, + () => resolve() + ) + }) }) }) } diff --git a/src/assets/javascripts/medium.js b/src/assets/javascripts/medium.js index 2d63eb4d..e5cb1dc4 100644 --- a/src/assets/javascripts/medium.js +++ b/src/assets/javascripts/medium.js @@ -52,7 +52,7 @@ function setRedirects(val) { scribeNormalRedirectsChecks, scribeTorRedirectsChecks: [...redirects.scribe.tor], scribeI2pRedirectsChecks: [...redirects.scribe.i2p], - scribeLokiRedirectsChecks: [...redirects.scribe.loki] + scribeLokiRedirectsChecks: [...redirects.scribe.loki], }) }) } @@ -184,12 +184,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - scribeNormalRedirectsChecks = [...redirects.scribe.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = scribeNormalRedirectsChecks.indexOf(instance) - if (a > -1) scribeNormalRedirectsChecks.splice(a, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + scribeNormalRedirectsChecks = [...redirects.scribe.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = scribeNormalRedirectsChecks.indexOf(instance) + if (a > -1) scribeNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableMedium: false, diff --git a/src/assets/javascripts/peertube.js b/src/assets/javascripts/peertube.js index 9819c01a..478a18f0 100644 --- a/src/assets/javascripts/peertube.js +++ b/src/assets/javascripts/peertube.js @@ -27,7 +27,7 @@ function setRedirects(val) { simpleertubeNormalRedirectsChecks, simpleertubeTorRedirectsChecks: [...redirects.simpleertube.tor], simpleertubeI2pRedirectsChecks: [...redirects.simpleertube.i2p], - simpleertubeLokiRedirectsChecks: [...redirects.simpleertube.loki] + simpleertubeLokiRedirectsChecks: [...redirects.simpleertube.loki], }) }) } @@ -165,12 +165,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = simpleertubeNormalRedirectsChecks.indexOf(instance) - if (a > -1) simpleertubeNormalRedirectsChecks.splice(a, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simpleertubeNormalRedirectsChecks.indexOf(instance) + if (a > -1) simpleertubeNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { peerTubeTargets: ["https://search.joinpeertube.org", ...dataJson.peertube], diff --git a/src/assets/javascripts/quora.js b/src/assets/javascripts/quora.js index e2412135..578cfe76 100644 --- a/src/assets/javascripts/quora.js +++ b/src/assets/javascripts/quora.js @@ -29,7 +29,7 @@ function setRedirects(val) { quetreNormalRedirectsChecks, quetreTorRedirectsChecks: [...redirects.quetre.tor], quetreI2pRedirectsChecks: [...redirects.quetre.i2p], - quetreLokiRedirectsChecks: [...redirects.quetre.loki] + quetreLokiRedirectsChecks: [...redirects.quetre.loki], }) }) } @@ -160,33 +160,33 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - quetreNormalRedirectsChecks = [...redirects.quetre.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = quetreNormalRedirectsChecks.indexOf(instance) - if (a > -1) quetreNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set( - { - disableQuora: false, - - quoraRedirects: redirects, - - quetreNormalRedirectsChecks, - quetreNormalCustomRedirects: [], - - quetreTorRedirectsChecks: [...redirects.quetre.tor], - quetreTorCustomRedirects: [], - - quetreI2pRedirectsChecks: [...redirects.quetre.i2p], - quetreI2pCustomRedirects: [], - - quetreLokiRedirectsChecks: [...redirects.quetre.loki], - quetreLokiCustomRedirects: [], - }, - () => resolve() - ) - }) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + quetreNormalRedirectsChecks = [...redirects.quetre.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = quetreNormalRedirectsChecks.indexOf(instance) + if (a > -1) quetreNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + disableQuora: false, + + quoraRedirects: redirects, + + quetreNormalRedirectsChecks, + quetreNormalCustomRedirects: [], + + quetreTorRedirectsChecks: [...redirects.quetre.tor], + quetreTorCustomRedirects: [], + + quetreI2pRedirectsChecks: [...redirects.quetre.i2p], + quetreI2pCustomRedirects: [], + + quetreLokiRedirectsChecks: [...redirects.quetre.loki], + quetreLokiCustomRedirects: [], + }, + () => resolve() + ) + }) }) }) } diff --git a/src/assets/javascripts/reddit.js b/src/assets/javascripts/reddit.js index 0d324e9e..ca1993b5 100644 --- a/src/assets/javascripts/reddit.js +++ b/src/assets/javascripts/reddit.js @@ -36,7 +36,7 @@ function setRedirects(val) { tedditNormalRedirectsChecks, tedditTorRedirectsChecks: [...redirects.teddit.tor], tedditI2pRedirectsChecks: [...redirects.teddit.i2p], - tedditLokiRedirectsChecks: [...redirects.teddit.loki] + tedditLokiRedirectsChecks: [...redirects.teddit.loki], }) }) } @@ -336,16 +336,16 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - libredditNormalRedirectsChecks = [...redirects.libreddit.normal] - tedditNormalRedirectsChecks = [...redirects.teddit.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = libredditNormalRedirectsChecks.indexOf(instance) - if (a > -1) libredditNormalRedirectsChecks.splice(a, 1) - - const b = tedditNormalRedirectsChecks.indexOf(instance) - if (b > -1) tedditNormalRedirectsChecks.splice(b, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + libredditNormalRedirectsChecks = [...redirects.libreddit.normal] + tedditNormalRedirectsChecks = [...redirects.teddit.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = libredditNormalRedirectsChecks.indexOf(instance) + if (a > -1) libredditNormalRedirectsChecks.splice(a, 1) + + const b = tedditNormalRedirectsChecks.indexOf(instance) + if (b > -1) tedditNormalRedirectsChecks.splice(b, 1) + } browser.storage.local.set( { disableReddit: false, diff --git a/src/assets/javascripts/reuters.js b/src/assets/javascripts/reuters.js index d1a0710b..51d16329 100644 --- a/src/assets/javascripts/reuters.js +++ b/src/assets/javascripts/reuters.js @@ -29,7 +29,7 @@ function setRedirects(val) { neutersNormalRedirectsChecks, neutersTorRedirectsChecks: [...redirects.neuters.tor], neutersI2pRedirectsChecks: [...redirects.neuters.i2p], - neutersLokiRedirectsChecks: [...redirects.neuters.loki] + neutersLokiRedirectsChecks: [...redirects.neuters.loki], }) }) } @@ -112,33 +112,33 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - neutersNormalRedirectsChecks = [...redirects.neuters.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = neutersNormalRedirectsChecks.indexOf(instance) - if (a > -1) neutersNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set( - { - disableReuters: true, - - reutersRedirects: redirects, - - neutersNormalRedirectsChecks, - neutersNormalCustomRedirects: [], - - neutersTorRedirectsChecks: [...redirects.neuters.tor], - neutersTorCustomRedirects: [], - - neutersI2pRedirectsChecks: [...redirects.neuters.i2p], - neutersI2pCustomRedirects: [], - - neutersLokiRedirectsChecks: [...redirects.neuters.loki], - neutersLokiCustomRedirects: [], - }, - () => resolve() - ) - }) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + neutersNormalRedirectsChecks = [...redirects.neuters.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = neutersNormalRedirectsChecks.indexOf(instance) + if (a > -1) neutersNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + disableReuters: true, + + reutersRedirects: redirects, + + neutersNormalRedirectsChecks, + neutersNormalCustomRedirects: [], + + neutersTorRedirectsChecks: [...redirects.neuters.tor], + neutersTorCustomRedirects: [], + + neutersI2pRedirectsChecks: [...redirects.neuters.i2p], + neutersI2pCustomRedirects: [], + + neutersLokiRedirectsChecks: [...redirects.neuters.loki], + neutersLokiCustomRedirects: [], + }, + () => resolve() + ) + }) }) }) } diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index 7a137eaf..64b56caa 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -53,7 +53,7 @@ function setRedirects(val) { librexNormalRedirectsChecks, librexTorRedirectsChecks: [...redirects.librex.tor], librexI2pRedirectsChecks: [...redirects.librex.i2p], - librexLokiRedirectsChecks: [...redirects.librex.loki] + librexLokiRedirectsChecks: [...redirects.librex.loki], }) }) } @@ -485,24 +485,24 @@ function initDefaults() { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - searxNormalRedirectsChecks = [...redirects.searx.normal] - searxngNormalRedirectsChecks = [...redirects.searxng.normal] - whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] - librexNormalRedirectsChecks = [...redirects.librex.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = searxNormalRedirectsChecks.indexOf(instance) - if (a > -1) searxNormalRedirectsChecks.splice(a, 1) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + searxNormalRedirectsChecks = [...redirects.searx.normal] + searxngNormalRedirectsChecks = [...redirects.searxng.normal] + whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] + librexNormalRedirectsChecks = [...redirects.librex.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = searxNormalRedirectsChecks.indexOf(instance) + if (a > -1) searxNormalRedirectsChecks.splice(a, 1) - const b = searxngNormalRedirectsChecks.indexOf(instance) - if (b > -1) searxngNormalRedirectsChecks.splice(b, 1) + const b = searxngNormalRedirectsChecks.indexOf(instance) + if (b > -1) searxngNormalRedirectsChecks.splice(b, 1) - const c = whoogleNormalRedirectsChecks.indexOf(instance) - if (c > -1) whoogleNormalRedirectsChecks.splice(c, 1) + const c = whoogleNormalRedirectsChecks.indexOf(instance) + if (c > -1) whoogleNormalRedirectsChecks.splice(c, 1) - const d = librexNormalRedirectsChecks.indexOf(instance) - if (d > -1) librexNormalRedirectsChecks.splice(d, 1) - } + const d = librexNormalRedirectsChecks.indexOf(instance) + if (d > -1) librexNormalRedirectsChecks.splice(d, 1) + } browser.storage.local.set( { disableSearch: false, diff --git a/src/assets/javascripts/sendTargets.js b/src/assets/javascripts/sendTargets.js index d17e969d..a52ab6ff 100644 --- a/src/assets/javascripts/sendTargets.js +++ b/src/assets/javascripts/sendTargets.js @@ -29,7 +29,7 @@ function setRedirects(val) { sendNormalRedirectsChecks, sendTorRedirectsChecks: [...redirects.send.tor], sendI2pRedirectsChecks: [...redirects.send.i2p], - sendLokiRedirectsChecks: [...redirects.send.loki] + sendLokiRedirectsChecks: [...redirects.send.loki], }) }) } @@ -157,12 +157,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - sendNormalRedirectsChecks = [...redirects.send.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = sendNormalRedirectsChecks.indexOf(instance) - if (a > -1) sendNormalRedirectsChecks.splice(a, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + sendNormalRedirectsChecks = [...redirects.send.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = sendNormalRedirectsChecks.indexOf(instance) + if (a > -1) sendNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableSendTarget: false, diff --git a/src/assets/javascripts/tiktok.js b/src/assets/javascripts/tiktok.js index 924aa81f..71f07687 100644 --- a/src/assets/javascripts/tiktok.js +++ b/src/assets/javascripts/tiktok.js @@ -29,7 +29,7 @@ function setRedirects(val) { proxiTokNormalRedirectsChecks, proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p], - proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki] + proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki], }) }) } @@ -205,34 +205,33 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - proxiTokNormalRedirectsChecks = [...redirects.proxiTok.normal] - console.log(r) - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = proxiTokNormalRedirectsChecks.indexOf(instance) - if (a > -1) proxiTokNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set( - { - disableTiktok: false, - - tiktokRedirects: redirects, - - proxiTokNormalRedirectsChecks, - proxiTokNormalCustomRedirects: [], - - proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], - proxiTokTorCustomRedirects: [], - - proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p], - proxiTokI2pCustomRedirects: [], - - proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki], - proxiTokLokiCustomRedirects: [], - }, - () => resolve() - ) - }) + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + proxiTokNormalRedirectsChecks = [...redirects.proxiTok.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = proxiTokNormalRedirectsChecks.indexOf(instance) + if (a > -1) proxiTokNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + disableTiktok: false, + + tiktokRedirects: redirects, + + proxiTokNormalRedirectsChecks, + proxiTokNormalCustomRedirects: [], + + proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], + proxiTokTorCustomRedirects: [], + + proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p], + proxiTokI2pCustomRedirects: [], + + proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki], + proxiTokLokiCustomRedirects: [], + }, + () => resolve() + ) + }) }) }) } diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 2e55c61b..993c630f 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -99,8 +99,8 @@ function setRedirects(val) { const a = simplyTranslateNormalCustomRedirects.indexOf(instance) if (a > -1) simplyTranslateNormalCustomRedirects.splice(a, 1) - const i = lingvaNormalRedirectsChecks.indexOf(instance) - if (i > -1) lingvaNormalRedirectsChecks.splice(i, 1) + const b = lingvaNormalRedirectsChecks.indexOf(instance) + if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1) } browser.storage.local.set({ translateRedirects: redirects, @@ -111,7 +111,7 @@ function setRedirects(val) { lingvaNormalRedirectsChecks, lingvaTorRedirectsChecks: [...redirects.lingva.tor], lingvaI2pRedirectsChecks: [...redirects.lingva.i2p], - lingvaLokiRedirectsChecks: [...redirects.lingva.loki] + lingvaLokiRedirectsChecks: [...redirects.lingva.loki], }) }) } @@ -310,22 +310,21 @@ function initDefaults() { return new Promise(async resolve => { fetch("/instances/data.json") .then(response => response.text()) - .then(data => { + .then(async data => { let dataJson = JSON.parse(data) for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - simplyTranslateNormalCustomRedirects = [...redirects.simplyTranslate.normal] - lingvaNormalRedirectsChecks = [...redirects.lingva.normal] - console.log(r.offlineBlackList) - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = simplyTranslateNormalCustomRedirects.indexOf(instance) - if (a > -1) simplyTranslateNormalCustomRedirects.splice(a, 1) - - const b = lingvaNormalRedirectsChecks.indexOf(instance) - if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + simplyTranslateNormalRedirectsChecks = [...redirects.simplyTranslate.normal] + lingvaNormalRedirectsChecks = [...redirects.lingva.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simplyTranslateNormalRedirectsChecks.indexOf(instance) + if (a > -1) simplyTranslateNormalRedirectsChecks.splice(a, 1) + + const b = lingvaNormalRedirectsChecks.indexOf(instance) + if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1) + } browser.storage.local.set( { translateDisable: false, diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 8131fbc2..7111ad00 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -29,7 +29,7 @@ function setRedirects(val) { nitterNormalRedirectsChecks, nitterTorRedirectsChecks: [...redirects.nitter.tor], nitterI2pRedirectsChecks: [...redirects.nitter.i2p], - nitterLokiRedirectsChecks: [...redirects.nitter.loki] + nitterLokiRedirectsChecks: [...redirects.nitter.loki], }) }) } @@ -226,12 +226,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { - nitterNormalRedirectsChecks = [...redirects.nitter.normal] - for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { - let i = nitterNormalRedirectsChecks.indexOf(instance) - if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) - } + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { + nitterNormalRedirectsChecks = [...redirects.nitter.normal] + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { + let i = nitterNormalRedirectsChecks.indexOf(instance) + if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) + } browser.storage.local.set( { disableTwitter: false, @@ -253,7 +253,7 @@ function initDefaults() { () => resolve() ) }) -}) + }) }) } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index c6cecc05..50ada765 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -62,7 +62,7 @@ function updateInstances() { invidious: instances.invidious, piped: instances.piped, pipedMaterial: instances.pipedMaterial, - cloudtube: instances.cloudtube + cloudtube: instances.cloudtube, }) twitterHelper.setRedirects(instances.nitter) instagramHelper.setRedirects(instances.bibliogram) diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index c72cb804..2d0f75a1 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -29,7 +29,7 @@ function setRedirects(val) { wikilessNormalRedirectsChecks, wikilessTorRedirectsChecks: [...redirects.wikiless.tor], wikilessI2pRedirectsChecks: [...redirects.wikiless.i2p], - wikilessLokiRedirectsChecks: [...redirects.wikiless.loki] + wikilessLokiRedirectsChecks: [...redirects.wikiless.loki], }) }) } @@ -203,12 +203,12 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = wikilessNormalRedirectsChecks.indexOf(instance) - if (a > -1) wikilessNormalRedirectsChecks.splice(a, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = wikilessNormalRedirectsChecks.indexOf(instance) + if (a > -1) wikilessNormalRedirectsChecks.splice(a, 1) + } browser.storage.local.set( { disableWikipedia: true, diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index b08ff909..32f06b9c 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -31,7 +31,7 @@ for (let i = 0; i < frontends.length; i++) { function setRedirects(val) { browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects = val + redirects = val invidiousNormalRedirectsChecks = [...redirects.invidious.normal] pipedNormalRedirectsChecks = [...redirects.piped.normal] pipedMaterialNormalRedirectsChecks = [...redirects.pipedMaterial.normal] @@ -66,7 +66,7 @@ function setRedirects(val) { cloudtubeNormalRedirectsChecks, cloudtubeTorRedirectsChecks: [...redirects.cloudtube.tor], cloudtubeI2pRedirectsChecks: [...redirects.cloudtube.i2p], - cloudtubeLokiRedirectsChecks: [...redirects.cloudtube.loki] + cloudtubeLokiRedirectsChecks: [...redirects.cloudtube.loki], }) }) } diff --git a/src/assets/javascripts/youtubeMusic.js b/src/assets/javascripts/youtubeMusic.js index f0b44e1f..797da4d5 100644 --- a/src/assets/javascripts/youtubeMusic.js +++ b/src/assets/javascripts/youtubeMusic.js @@ -39,7 +39,7 @@ function setRedirects(val) { hyperpipeNormalRedirectsChecks, hyperpipeTorRedirectsChecks: [...redirects.hyperpipe.tor], hyperpipeI2pRedirectsChecks: [...redirects.hyperpipe.i2p], - hyperpipeLokiRedirectsChecks: [...redirects.hyperpipe.loki] + hyperpipeLokiRedirectsChecks: [...redirects.hyperpipe.loki], }) }) } @@ -272,16 +272,16 @@ function initDefaults() { for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = dataJson[frontends[i]] } - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] - hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = beatbumpNormalRedirectsChecks.indexOf(instance) - if (a > -1) beatbumpNormalRedirectsChecks.splice(a, 1) - - const b = hyperpipeNormalRedirectsChecks.indexOf(instance) - if (b > -1) hyperpipeNormalRedirectsChecks.splice(b, 1) - } + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] + hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = beatbumpNormalRedirectsChecks.indexOf(instance) + if (a > -1) beatbumpNormalRedirectsChecks.splice(a, 1) + + const b = hyperpipeNormalRedirectsChecks.indexOf(instance) + if (b > -1) hyperpipeNormalRedirectsChecks.splice(b, 1) + } browser.storage.local.set( { disableYoutubeMusic: false, -- cgit 1.4.1 From 77b1f094b05a7efc6e5a7a743125ce63ada3da0b Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Tue, 2 Aug 2022 23:10:45 +0100 Subject: Push part of config draft I had more exiting stuff like ejs, but I accidentially deleted the files D: --- src/config/config.json | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/config/config.json diff --git a/src/config/config.json b/src/config/config.json new file mode 100644 index 00000000..d918a0ad --- /dev/null +++ b/src/config/config.json @@ -0,0 +1,98 @@ +{ + "networks": { + "normal": { + "url": "org", + "name": "Clearnet" + }, + "tor": { + "url": "onion", + "name": "Tor" + }, + "i2p": { + "url": "i2p", + "name": "I2P" + }, + "loki": { + "url": "loki", + "name": "Lokinet" + } + }, + "services": { + "youtube": { + "frontends": { + "invidious": { + "preferences": { + "method": "cookies", + "cookies": ["PREFS"] + } + }, + "piped": { + "preferences": { + "method": "localstorage", + "localstorage": [ + "bufferGoal", + "comments", + "disableLBRY", + "enabledCodecs", + "hl", + "homepage", + "instance", + "listen", + "minimizeDescription", + "playerAutoPlay", + "proxyLBRY", + "quality", + "region", + "selectedSkip", + "sponsorblock", + "theme", + "volume", + "watchHistory" + ] + } + }, + "pipedMaterial": { + "preferences": { + "method": "localstorage", + "localstorage": ["PREFERENCES"] + } + }, + "cloudtube": { + "preferences": { + "method": "token", + "token": "token", + "fetchEndpoint": "/api/settings", + "setEndpoint": "/settings" + } + } + }, + "singleInstanceFrontends": { + "freetube": {}, + "yatte": {} + }, + "targets": [ + "/^https?:\\/{2}(www.|music.|m.|)youtube.com(\\/.*|$)/", + "/^https?:\\/{2}img.youtube.com\\/vi\\/.*\\/..*/", + "/^https?:\\/{2}(i|s).ytimg.com\\/vi\\/.*\\/..*/", + "/^https?:\\/{2}(www.|music.|)youtube.com\\/watch?v=..*/", + "/^https?:\\/{2}youtu.be\\/..*/", + "/^https?:\\/{2}(www.|)(youtube|youtube-nocookie).com\\/embed\\/..*/" + ], + "name": "Youtube", + "defaults": { + "disableYoutube": false, + "enableYoutubeCustomSettings": false, + "onlyEmbeddedVideo": "both", + "youtubeFrontend": "invidious", + "youtubeEmbedFrontend": "invidious" + }, + "youtubeMusic": { + "frontends": { + "beatbump": {}, + "hyperpipe": {} + }, + "targets": ["^https?:\\/{2}music\.youtube\.com(\\/.*|$)"] + } + } + } +} -- cgit 1.4.1 From 1a8e130d18787d15ab648c2f5bef7bf2b237211b Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 3 Aug 2022 13:18:25 +0200 Subject: Update 'README.md' --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 4de39765..db740eb0 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,6 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to altern [![LibrePay Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect) [![Firefox Add-on](./img/badge-amo.png)](https://addons.mozilla.org/firefox/addon/libredirect/)  - - -  -- cgit 1.4.1 From 0cd1947ad90b7a3ea16dcab41f11b5be0c5a47fd Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 3 Aug 2022 14:12:03 +0100 Subject: Update blacklist pt1 --- src/assets/javascripts/search.js | 2 +- src/assets/javascripts/utils.js | 46 ++++++++++++++++++++++++++++++++++++++-- src/instances/get_instances.py | 2 +- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index 64b56caa..8e92e9c6 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -7,7 +7,7 @@ const targets = [/^https?:\/{2}search\.libredirect\.invalid/] const frontends = new Array("searx", "searxng", "whoogle", "librex") const protocols = new Array("normal", "tor", "i2p", "loki") -const redirects = {} +let redirects = {} for (let i = 0; i < frontends.length; i++) { redirects[frontends[i]] = {} diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 50ada765..81fb181f 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -28,14 +28,56 @@ let authenticateBlackList = [] let offlineBlackList = [] async function initBlackList() { return new Promise(resolve => { + browser.storage.local.get([ + "cloudflareBlackList", + "authenticateBlackList", + "offlineBlackList" + ], + r => { + cloudflareBlackList = r.cloudflareBlackList + authenticateBlackList = r.authenticateBlackList + offlineBlackList = r.offlineBlackList + }) + if (cloudflareBlackList.length == 0) { fetch("/instances/blacklist.json") .then(response => response.text()) .then(data => { cloudflareBlackList = JSON.parse(data).cloudflare authenticateBlackList = JSON.parse(data).authenticate offlineBlackList = JSON.parse(data).offline - resolve() }) + } + console.log(offlineBlackList) + resolve() + }) +} + +function updateBlackList() { + return new Promise(async resolve => { + let http = new XMLHttpRequest() + let fallback = new XMLHttpRequest() + http.open("GET", "https://codeberg.org/LibRedirect/libredirect/raw/branch/master/src/instances/blacklist.json", false) + http.send(null) + if (http.status != 200) { + fallback.open("GET", "https://raw.githubusercontent.com/libredirect/libredirect/master/src/instances/blacklist.json", false) + fallback.send(null) + if (fallback.status === 200) { + http = fallback + } else { + resolve() + return + } + } + const blackList = JSON.parse(http.responseText) + browser.storage.local.set({ + cloudflareBlackList: blackList.cloudflare, + authenticateBlackList: blackList.authenticate, + offlineBlackList: blackList.offline + }) + cloudflareBlackList = blackList.cloudflare, + authenticateBlackList = blackList.authenticate, + offlineBlackList = blackList.offline + resolve() }) } @@ -55,7 +97,7 @@ function updateInstances() { return } } - await initBlackList() + await updateBlackList() const instances = JSON.parse(http.responseText) youtubeHelper.setRedirects({ diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index eab4a924..085d7273 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -661,7 +661,7 @@ for k1, v1 in mightyList.items(): cloudflare.append(instance) if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_authenticate(instance): authenticate.append(instance) - if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_offline(instance): + elif not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_offline(instance): offline.append(instance) peertube() -- cgit 1.4.1 From 2460d24aba22fb196013a11f0256331b9ec65cbf Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 3 Aug 2022 14:16:18 +0100 Subject: Make checkbox actually work --- .gitea/issue_template/bug.md | 3 ++- .gitea/issue_template/feature.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/issue_template/bug.md b/.gitea/issue_template/bug.md index 13de17e6..3dfb0b73 100644 --- a/.gitea/issue_template/bug.md +++ b/.gitea/issue_template/bug.md @@ -28,4 +28,5 @@ Libredirect version:
-[ ] I have checked on codeberg and github and can confirm this issue is not a duplicate. + +- [ ] I have checked on codeberg and github and can confirm this issue is not a duplicate. diff --git a/.gitea/issue_template/feature.md b/.gitea/issue_template/feature.md index 2b08ce22..6993b6d4 100644 --- a/.gitea/issue_template/feature.md +++ b/.gitea/issue_template/feature.md @@ -11,4 +11,5 @@ labels:
-[ ] I have checked on codeberg and github and can confirm this issue is not a duplicate. + +- [ ] I have checked on codeberg and github and can confirm this issue is not a duplicate. -- cgit 1.4.1 From d3dca6a91bcf79b46745743d1d82957b5e8b0132 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Wed, 3 Aug 2022 14:51:14 +0100 Subject: Fix some beatbump redirects --- src/assets/javascripts/youtubeMusic.js | 2 +- src/instances/beatbump.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/assets/javascripts/youtubeMusic.js b/src/assets/javascripts/youtubeMusic.js index 797da4d5..5d980cfe 100644 --- a/src/assets/javascripts/youtubeMusic.js +++ b/src/assets/javascripts/youtubeMusic.js @@ -187,7 +187,7 @@ function getUrl(randomInstance, url) { .replace("/watch?v=", "/listen?id=") .replace("/channel/", "/artist/") .replace("/playlist?list=", "/playlist/VL") - .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=EgWKAQIIAWoKEAMQBBAKEAkQBQ%3D%3D") + .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=song") case "hyperpipe": return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) } diff --git a/src/instances/beatbump.json b/src/instances/beatbump.json index 4c7f65a6..df5a20f7 100644 --- a/src/instances/beatbump.json +++ b/src/instances/beatbump.json @@ -1,5 +1,8 @@ { - "normal": ["https://beatbump.ml"], + "normal": [ + "https://beatbump.ml", + "https://beatbump.esmailelbob.xyz" + ], "tor": [], "i2p": [], "loki": [] -- cgit 1.4.1 From 029b7b09d5ab5c7fee25f4956c2e7e26da5f1c9d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 4 Aug 2022 22:42:51 +0000 Subject: update instances --- src/instances/blacklist.json | 14 +++++++++++--- src/instances/data.json | 12 +++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 642a6639..b8b04a01 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -1,11 +1,11 @@ { "cloudflare": [ "https://invidious.kavin.rocks", + "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://jp-piped.shimul.me", + "https://us-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", @@ -59,10 +59,16 @@ "https://invidious.snopyta.org", "https://tok.habedieeh.re", "https://n.hyperborea.cloud", + "https://de.nttr.stream", + "https://twitter.dr460nf1r3.org", + "https://nitter.catalyst.sx", "https://bibliogram.snopyta.org", - "https://insta.trom.tf", "https://libreddit.autarkic.org", + "https://de.leddit.xyz", + "https://reddi.tk", "https://libreddit.notyourcomputer.net", + "https://reddit.dr460nf1r3.org", + "https://translate.dr460nf1r3.org", "https://anon.sx", "https://jsearch.pw", "https://searx.gnu.style", @@ -73,7 +79,9 @@ "https://searx.ericaftereric.top", "https://searx.fmac.xyz", "https://searxng.au/searx", + "https://www.webrats.xyz", "https://search.albony.xyz", + "https://search.dr460nf1r3.org", "https://whoogle.esmailelbob.xyz", "https://beatbump.ml", "https://stube.tokhmi.xyz" diff --git a/src/instances/data.json b/src/instances/data.json index 0565348b..bc44745b 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -7,6 +7,7 @@ "https://inv.riverside.rocks", "https://invidious.osi.kr", "https://y.com.sb", + "https://yt.artemislena.eu", "https://invidious.flokinet.to", "https://invidious.sethforprivacy.com", "https://invidious.tiekoetter.com", @@ -20,7 +21,6 @@ "https://invidious.weblibre.org", "https://invidious.snopyta.org", "https://invidious.esmailelbob.xyz", - "https://yt.artemislena.eu", "https://invidious.namazso.eu" ], "tor": [ @@ -39,12 +39,12 @@ }, "piped": { "normal": [ + "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://il.ax", - "https://piped.syncpundit.com", "https://piped.mha.fi", - "https://jp-piped.shimul.me", + "https://us-piped.shimul.me", "https://pipedus.palash.dev", "https://piped.waffle.wiki", "https://watch.whatever.social", @@ -478,7 +478,6 @@ "https://dynabyte.ca", "https://jsearch.pw", "https://northboot.xyz", - "https://search.affusio.com", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -494,7 +493,6 @@ "https://searx.netzspielplatz.de", "https://searx.nixnet.services", "https://searx.org", - "https://searx.rasp.fr", "https://searx.ru", "https://searx.run", "https://searx.semipvt.com", @@ -518,7 +516,6 @@ "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", - "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", @@ -544,6 +541,7 @@ "https://s.zhaocloud.net", "https://saber.tk", "https://search.0relay.com", + "https://search.affusio.com", "https://search.ashs.club", "https://search.bingowaves.xyz", "https://search.bus-hit.me", @@ -601,6 +599,7 @@ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", + "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", @@ -1381,7 +1380,6 @@ "https://peertube.inapurna.org", "https://watch.libertaria.space", "https://video.triplea.fr", - "https://video.catgirl.biz", "https://vulgarisation-informatique.fr", "https://tube.kotur.org", "https://peertube.euskarabildua.eus", -- cgit 1.4.1 From 93b181901c45481a3e6e433b7169debc817353fe Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 6 Aug 2022 09:12:43 +0300 Subject: Made setRedirect functions async --- src/assets/javascripts/frontend.js | 33 +++++++++++ src/assets/javascripts/imdb.js | 33 ++++++----- src/assets/javascripts/imgur.js | 33 ++++++----- src/assets/javascripts/instagram.js | 33 ++++++----- src/assets/javascripts/lbry.js | 33 ++++++----- src/assets/javascripts/maps.js | 33 ++++++----- src/assets/javascripts/medium.js | 33 ++++++----- src/assets/javascripts/peertube.js | 33 ++++++----- src/assets/javascripts/quora.js | 37 ++++++------ src/assets/javascripts/reddit.js | 62 +++++++++++--------- src/assets/javascripts/reuters.js | 33 ++++++----- src/assets/javascripts/search.js | 81 ++++++++++++++------------- src/assets/javascripts/sendTargets.js | 33 ++++++----- src/assets/javascripts/tiktok.js | 33 ++++++----- src/assets/javascripts/translate/translate.js | 49 ++++++++-------- src/assets/javascripts/twitter.js | 33 ++++++----- src/assets/javascripts/utils.js | 72 +++++++++++------------- src/assets/javascripts/wikipedia.js | 33 ++++++----- src/assets/javascripts/youtube/youtube.js | 81 ++++++++++++++------------- src/assets/javascripts/youtubeMusic.js | 49 ++++++++-------- src/pages/options/index.html | 20 +++---- src/pages/options/widgets/general.js | 49 ++++++++-------- src/pages/options/widgets/general.pug | 6 +- src/pages/options/widgets/imdb.pug | 2 +- src/pages/options/widgets/quora.pug | 2 +- src/pages/options/widgets/reuters.pug | 2 +- src/pages/popup/popup.html | 12 ++-- src/pages/popup/popup.pug | 6 +- src/pages/widgets/links.pug | 6 +- 29 files changed, 541 insertions(+), 424 deletions(-) create mode 100644 src/assets/javascripts/frontend.js diff --git a/src/assets/javascripts/frontend.js b/src/assets/javascripts/frontend.js new file mode 100644 index 00000000..73b864b4 --- /dev/null +++ b/src/assets/javascripts/frontend.js @@ -0,0 +1,33 @@ +class FrontEnd { + constructor({ name, redirect, frontends, protocols, enable }) { + this.name = name + this.redirect = redirect + this.enable = enable + fetch("/instances/data.json") + .then(response => response.text()) + .then(async data => { + const json = JSON.parse(data) + this.frontends = {} + for (const frontend of frontends) { + this.frontends[frontend] = json[frontend] + for (const protocol of json[frontend]) { + browser.storage.local.set({ + [`${name}_${protocol}_checks`]: json[frontend][protocol], + }) + } + } + }) + + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => {}) + this.protocols = protocols + } + switchInstance(url) {} +} + +let Reddit = new FrontEnd({ + name: "youtube", + redirect: function () {}, + targets: [/^https?:\/{2}(www\.|old\.|np\.|new\.|amp\.|)reddit\.com/, /^https?:\/{2}(i\.|preview\.)redd\.it/], + frontends: ["libreddit", "teddit"], + enable: true, +}) diff --git a/src/assets/javascripts/imdb.js b/src/assets/javascripts/imdb.js index 57368557..604e9a9e 100644 --- a/src/assets/javascripts/imdb.js +++ b/src/assets/javascripts/imdb.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.libremdb = val - libremdbNormalRedirectsChecks = [...redirects.libremdb.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = libremdbNormalRedirectsChecks.indexOf(instance) - if (a > -1) libremdbNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - imdbRedirects: redirects, - libremdbNormalRedirectsChecks, - libremdbTorRedirectsChecks: [...redirects.libremdb.tor], - libremdbI2pRedirectsChecks: [...redirects.libremdb.i2p], - libremdbLokiRedirectsChecks: [...redirects.libremdb.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.libremdb = val + libremdbNormalRedirectsChecks = [...redirects.libremdb.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = libremdbNormalRedirectsChecks.indexOf(instance) + if (a > -1) libremdbNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + imdbRedirects: redirects, + libremdbNormalRedirectsChecks, + libremdbTorRedirectsChecks: [...redirects.libremdb.tor], + libremdbI2pRedirectsChecks: [...redirects.libremdb.i2p], + libremdbLokiRedirectsChecks: [...redirects.libremdb.loki], + }, + () => resolve() + ) }) - }) + ) } let disableImdb, diff --git a/src/assets/javascripts/imgur.js b/src/assets/javascripts/imgur.js index 15b9ccac..24e8cb8d 100644 --- a/src/assets/javascripts/imgur.js +++ b/src/assets/javascripts/imgur.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.rimgo = val - rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = rimgoNormalRedirectsChecks.indexOf(instance) - if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - imgurRedirects: redirects, - rimgoNormalRedirectsChecks, - rimgoTorRedirectsChecks: [...redirects.rimgo.tor], - rimgoI2pRedirectsChecks: [...redirects.rimgo.i2p], - rimgoLokiRedirectsChecks: [...redirects.rimgo.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.rimgo = val + rimgoNormalRedirectsChecks = [...redirects.rimgo.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = rimgoNormalRedirectsChecks.indexOf(instance) + if (a > -1) rimgoNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + imgurRedirects: redirects, + rimgoNormalRedirectsChecks, + rimgoTorRedirectsChecks: [...redirects.rimgo.tor], + rimgoI2pRedirectsChecks: [...redirects.rimgo.i2p], + rimgoLokiRedirectsChecks: [...redirects.rimgo.loki], + }, + () => resolve() + ) }) - }) + ) } let disableImgur, diff --git a/src/assets/javascripts/instagram.js b/src/assets/javascripts/instagram.js index d0aa07c0..bc580de7 100644 --- a/src/assets/javascripts/instagram.js +++ b/src/assets/javascripts/instagram.js @@ -16,21 +16,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { - redirects.bibliogram = val - bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = bibliogramNormalRedirectsChecks.indexOf(instance) - if (a > -1) bibliogramNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - instagramRedirects: redirects, - bibliogramNormalRedirectsChecks, - bibliogramTorRedirectsChecks: [...redirects.bibliogram.tor], - bibliogramI2pRedirectsChecks: [...redirects.bibliogram.i2p], - bibliogramLokiRedirectsChecks: [...redirects.bibliogram.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { + redirects.bibliogram = val + bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = bibliogramNormalRedirectsChecks.indexOf(instance) + if (a > -1) bibliogramNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + instagramRedirects: redirects, + bibliogramNormalRedirectsChecks, + bibliogramTorRedirectsChecks: [...redirects.bibliogram.tor], + bibliogramI2pRedirectsChecks: [...redirects.bibliogram.i2p], + bibliogramLokiRedirectsChecks: [...redirects.bibliogram.loki], + }, + () => resolve() + ) }) - }) + ) } let disableInstagram, diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index 5e285ada..5819d132 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.librarian = val - librarianNormalRedirectsChecks = [...redirects.librarian.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = librarianNormalRedirectsChecks.indexOf(instance) - if (a > -1) librarianNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - lbryTargetsRedirects: redirects, - librarianNormalRedirectsChecks, - librarianTorRedirectsChecks: [...redirects.librarian.tor], - librarianI2pRedirectsChecks: [...redirects.librarian.i2p], - librarianLokiRedirectsChecks: [...redirects.librarian.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.librarian = val + librarianNormalRedirectsChecks = [...redirects.librarian.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = librarianNormalRedirectsChecks.indexOf(instance) + if (a > -1) librarianNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + lbryTargetsRedirects: redirects, + librarianNormalRedirectsChecks, + librarianTorRedirectsChecks: [...redirects.librarian.tor], + librarianI2pRedirectsChecks: [...redirects.librarian.i2p], + librarianLokiRedirectsChecks: [...redirects.librarian.loki], + }, + () => resolve() + ) }) - }) + ) } let disableLbryTargets, diff --git a/src/assets/javascripts/maps.js b/src/assets/javascripts/maps.js index 6e3c9af0..6911c9ba 100644 --- a/src/assets/javascripts/maps.js +++ b/src/assets/javascripts/maps.js @@ -21,21 +21,26 @@ redirects.osm = {} redirects.osm.normal = ["https://www.openstreetmap.org"] function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.facil = val - facilNormalRedirectsChecks = [...redirects.facil.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = facilNormalRedirectsChecks.indexOf(instance) - if (a > -1) facilNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - mapsRedirects: redirects, - facilNormalRedirectsChecks, - facilTorRedirectsChecks: [...redirects.facil.tor], - facilI2pRedirectsChecks: [...redirects.facil.i2p], - facilLokiRedirectsChecks: [...redirects.facil.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.facil = val + facilNormalRedirectsChecks = [...redirects.facil.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = facilNormalRedirectsChecks.indexOf(instance) + if (a > -1) facilNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + mapsRedirects: redirects, + facilNormalRedirectsChecks, + facilTorRedirectsChecks: [...redirects.facil.tor], + facilI2pRedirectsChecks: [...redirects.facil.i2p], + facilLokiRedirectsChecks: [...redirects.facil.loki], + }, + () => resolve() + ) }) - }) + ) } let disableMaps, diff --git a/src/assets/javascripts/medium.js b/src/assets/javascripts/medium.js index e5cb1dc4..386d234c 100644 --- a/src/assets/javascripts/medium.js +++ b/src/assets/javascripts/medium.js @@ -40,21 +40,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.scribe = val - scribeNormalRedirectsChecks = [...redirects.scribe.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = scribeNormalRedirectsChecks.indexOf(instance) - if (a > -1) scribeNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - mediumRedirects: redirects, - scribeNormalRedirectsChecks, - scribeTorRedirectsChecks: [...redirects.scribe.tor], - scribeI2pRedirectsChecks: [...redirects.scribe.i2p], - scribeLokiRedirectsChecks: [...redirects.scribe.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.scribe = val + scribeNormalRedirectsChecks = [...redirects.scribe.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = scribeNormalRedirectsChecks.indexOf(instance) + if (a > -1) scribeNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + mediumRedirects: redirects, + scribeNormalRedirectsChecks, + scribeTorRedirectsChecks: [...redirects.scribe.tor], + scribeI2pRedirectsChecks: [...redirects.scribe.i2p], + scribeLokiRedirectsChecks: [...redirects.scribe.loki], + }, + () => resolve() + ) }) - }) + ) } let disableMedium, diff --git a/src/assets/javascripts/peertube.js b/src/assets/javascripts/peertube.js index 478a18f0..e1ff406f 100644 --- a/src/assets/javascripts/peertube.js +++ b/src/assets/javascripts/peertube.js @@ -15,21 +15,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.simpleertube = val - simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = simpleertubeNormalRedirectsChecks.indexOf(instance) - if (a > -1) simpleertubeNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - peertubeRedirects: redirects, - simpleertubeNormalRedirectsChecks, - simpleertubeTorRedirectsChecks: [...redirects.simpleertube.tor], - simpleertubeI2pRedirectsChecks: [...redirects.simpleertube.i2p], - simpleertubeLokiRedirectsChecks: [...redirects.simpleertube.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.simpleertube = val + simpleertubeNormalRedirectsChecks = [...redirects.simpleertube.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simpleertubeNormalRedirectsChecks.indexOf(instance) + if (a > -1) simpleertubeNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + peertubeRedirects: redirects, + simpleertubeNormalRedirectsChecks, + simpleertubeTorRedirectsChecks: [...redirects.simpleertube.tor], + simpleertubeI2pRedirectsChecks: [...redirects.simpleertube.i2p], + simpleertubeLokiRedirectsChecks: [...redirects.simpleertube.loki], + }, + () => resolve() + ) }) - }) + ) } let disablePeertubeTargets, diff --git a/src/assets/javascripts/quora.js b/src/assets/javascripts/quora.js index 578cfe76..4473c3d7 100644 --- a/src/assets/javascripts/quora.js +++ b/src/assets/javascripts/quora.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.quetre = val - quetreNormalRedirectsChecks = [...redirects.quetre.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = quetreNormalRedirectsChecks.indexOf(instance) - if (a > -1) quetreNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - quoraRedirects: redirects, - quetreNormalRedirectsChecks, - quetreTorRedirectsChecks: [...redirects.quetre.tor], - quetreI2pRedirectsChecks: [...redirects.quetre.i2p], - quetreLokiRedirectsChecks: [...redirects.quetre.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.quetre = val + quetreNormalRedirectsChecks = [...redirects.quetre.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = quetreNormalRedirectsChecks.indexOf(instance) + if (a > -1) quetreNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + quoraRedirects: redirects, + quetreNormalRedirectsChecks, + quetreTorRedirectsChecks: [...redirects.quetre.tor], + quetreI2pRedirectsChecks: [...redirects.quetre.i2p], + quetreLokiRedirectsChecks: [...redirects.quetre.loki], + }, + () => resolve() + ) }) - }) + ) } let disableQuora, @@ -95,9 +100,7 @@ function redirect(url, type, initiator, disableOverride) { if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { instancesList = [...quetreNormalRedirectsChecks, ...quetreNormalCustomRedirects] } - if (instancesList.length === 0) { - return - } + if (instancesList.length === 0) return const randomInstance = utils.getRandomInstance(instancesList) return `${randomInstance}${url.pathname}` diff --git a/src/assets/javascripts/reddit.js b/src/assets/javascripts/reddit.js index ca1993b5..209ee7e3 100644 --- a/src/assets/javascripts/reddit.js +++ b/src/assets/javascripts/reddit.js @@ -16,29 +16,34 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects = val - libredditNormalRedirectsChecks = [...redirects.libreddit.normal] - tedditNormalRedirectsChecks = [...redirects.teddit.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = libredditNormalRedirectsChecks.indexOf(instance) - if (a > -1) libredditNormalRedirectsChecks.splice(a, 1) - - const b = tedditNormalRedirectsChecks.indexOf(instance) - if (b > -1) tedditNormalRedirectsChecks.splice(b, 1) - } - browser.storage.local.set({ - redditRedirects: redirects, - libredditNormalRedirectsChecks, - libredditTorRedirectsChecks: [...redirects.libreddit.tor], - libredditI2pRedirectsChecks: [...redirects.libreddit.i2p], - libredditLokiRedirectsChecks: [...redirects.libreddit.loki], - tedditNormalRedirectsChecks, - tedditTorRedirectsChecks: [...redirects.teddit.tor], - tedditI2pRedirectsChecks: [...redirects.teddit.i2p], - tedditLokiRedirectsChecks: [...redirects.teddit.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects = val + libredditNormalRedirectsChecks = [...redirects.libreddit.normal] + tedditNormalRedirectsChecks = [...redirects.teddit.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = libredditNormalRedirectsChecks.indexOf(instance) + if (a > -1) libredditNormalRedirectsChecks.splice(a, 1) + + const b = tedditNormalRedirectsChecks.indexOf(instance) + if (b > -1) tedditNormalRedirectsChecks.splice(b, 1) + } + browser.storage.local.set( + { + redditRedirects: redirects, + libredditNormalRedirectsChecks, + libredditTorRedirectsChecks: [...redirects.libreddit.tor], + libredditI2pRedirectsChecks: [...redirects.libreddit.i2p], + libredditLokiRedirectsChecks: [...redirects.libreddit.loki], + tedditNormalRedirectsChecks, + tedditTorRedirectsChecks: [...redirects.teddit.tor], + tedditI2pRedirectsChecks: [...redirects.teddit.i2p], + tedditLokiRedirectsChecks: [...redirects.teddit.loki], + }, + () => resolve() + ) }) - }) + ) } let disableReddit, @@ -304,7 +309,9 @@ function switchInstance(url, disableOverride) { if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { instancesList = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects] } - if ([...redditRedirects.teddit.normal, ...redditRedirects.teddit.tor].includes(protocolHost)) url.pathname = url.pathname.replace("/pics/w:null_", "/img/") + if ([...redditRedirects.teddit.normal, ...redditRedirects.teddit.tor].includes(protocolHost)) { + url.pathname = url.pathname.replace("/pics/w:null_", "/img/") + } } else if (redditFrontend == "teddit") { if (protocol == "loki") instancesList = [...tedditLokiCustomRedirects] else if (protocol == "i2p") instancesList = [...tedditI2pCustomRedirects] @@ -312,7 +319,9 @@ function switchInstance(url, disableOverride) { if ((instancesList.length === 0 && protocolFallback) || protocol == "normal") { instancesList = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects] } - if ([...redditRedirects.libreddit.normal, ...redditRedirects.libreddit.tor].includes(protocolHost)) url.pathname = url.pathname.replace("/img/", "/pics/w:null_") + if ([...redditRedirects.libreddit.normal, ...redditRedirects.libreddit.tor].includes(protocolHost)) { + url.pathname = url.pathname.replace("/img/", "/pics/w:null_") + } } const i = instancesList.indexOf(protocolHost) @@ -333,9 +342,8 @@ function initDefaults() { .then(response => response.text()) .then(async data => { let dataJson = JSON.parse(data) - for (let i = 0; i < frontends.length; i++) { - redirects[frontends[i]] = dataJson[frontends[i]] - } + for (const frontend of frontends) redirects[frontend] = dataJson[frontend] + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], async r => { libredditNormalRedirectsChecks = [...redirects.libreddit.normal] tedditNormalRedirectsChecks = [...redirects.teddit.normal] diff --git a/src/assets/javascripts/reuters.js b/src/assets/javascripts/reuters.js index 51d16329..16459b4a 100644 --- a/src/assets/javascripts/reuters.js +++ b/src/assets/javascripts/reuters.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.neuters = val - neutersNormalRedirectsChecks = [...redirects.neuters.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = neutersNormalRedirectsChecks.indexOf(instance) - if (a > -1) neutersNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - neutersRedirects: redirects, - neutersNormalRedirectsChecks, - neutersTorRedirectsChecks: [...redirects.neuters.tor], - neutersI2pRedirectsChecks: [...redirects.neuters.i2p], - neutersLokiRedirectsChecks: [...redirects.neuters.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.neuters = val + neutersNormalRedirectsChecks = [...redirects.neuters.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = neutersNormalRedirectsChecks.indexOf(instance) + if (a > -1) neutersNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + neutersRedirects: redirects, + neutersNormalRedirectsChecks, + neutersTorRedirectsChecks: [...redirects.neuters.tor], + neutersI2pRedirectsChecks: [...redirects.neuters.i2p], + neutersLokiRedirectsChecks: [...redirects.neuters.loki], + }, + () => resolve() + ) }) - }) + ) } let disableReuters, diff --git a/src/assets/javascripts/search.js b/src/assets/javascripts/search.js index 8e92e9c6..548e7629 100644 --- a/src/assets/javascripts/search.js +++ b/src/assets/javascripts/search.js @@ -17,45 +17,50 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects = val - searxNormalRedirectsChecks = [...redirects.searx.normal] - searxngNormalRedirectsChecks = [...redirects.searxng.normal] - whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] - librexNormalRedirectsChecks = [...redirects.librex.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = searxNormalRedirectsChecks.indexOf(instance) - if (a > -1) searxNormalRedirectsChecks.splice(a, 1) - - const b = searxngNormalRedirectsChecks.indexOf(instance) - if (b > -1) searxngNormalRedirectsChecks.splice(b, 1) - - const c = whoogleNormalRedirectsChecks.indexOf(instance) - if (c > -1) whoogleNormalRedirectsChecks.splice(c, 1) - - const d = librexNormalRedirectsChecks.indexOf(instance) - if (d > -1) librexNormalRedirectsChecks.splice(d, 1) - } - browser.storage.local.set({ - searchRedirects: redirects, - searxNormalRedirectsChecks, - searxTorRedirectsChecks: [...redirects.searx.tor], - searxI2pRedirectsChecks: [...redirects.searx.i2p], - searxLokiRedirectsChecks: [...redirects.searx.loki], - searxngNormalRedirectsChecks, - searxngTorRedirectsChecks: [...redirects.searxng.tor], - searxngI2pRedirectsChecks: [...redirects.searxng.i2p], - searxngLokiRedirectsChecks: [...redirects.searxng.loki], - whoogleNormalRedirectsChecks, - whoogleTorRedirectsChecks: [...redirects.whoogle.tor], - whoogleI2pRedirectsChecks: [...redirects.whoogle.i2p], - whoogleLokiRedirectsChecks: [...redirects.whoogle.loki], - librexNormalRedirectsChecks, - librexTorRedirectsChecks: [...redirects.librex.tor], - librexI2pRedirectsChecks: [...redirects.librex.i2p], - librexLokiRedirectsChecks: [...redirects.librex.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects = val + searxNormalRedirectsChecks = [...redirects.searx.normal] + searxngNormalRedirectsChecks = [...redirects.searxng.normal] + whoogleNormalRedirectsChecks = [...redirects.whoogle.normal] + librexNormalRedirectsChecks = [...redirects.librex.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = searxNormalRedirectsChecks.indexOf(instance) + if (a > -1) searxNormalRedirectsChecks.splice(a, 1) + + const b = searxngNormalRedirectsChecks.indexOf(instance) + if (b > -1) searxngNormalRedirectsChecks.splice(b, 1) + + const c = whoogleNormalRedirectsChecks.indexOf(instance) + if (c > -1) whoogleNormalRedirectsChecks.splice(c, 1) + + const d = librexNormalRedirectsChecks.indexOf(instance) + if (d > -1) librexNormalRedirectsChecks.splice(d, 1) + } + browser.storage.local.set( + { + searchRedirects: redirects, + searxNormalRedirectsChecks, + searxTorRedirectsChecks: [...redirects.searx.tor], + searxI2pRedirectsChecks: [...redirects.searx.i2p], + searxLokiRedirectsChecks: [...redirects.searx.loki], + searxngNormalRedirectsChecks, + searxngTorRedirectsChecks: [...redirects.searxng.tor], + searxngI2pRedirectsChecks: [...redirects.searxng.i2p], + searxngLokiRedirectsChecks: [...redirects.searxng.loki], + whoogleNormalRedirectsChecks, + whoogleTorRedirectsChecks: [...redirects.whoogle.tor], + whoogleI2pRedirectsChecks: [...redirects.whoogle.i2p], + whoogleLokiRedirectsChecks: [...redirects.whoogle.loki], + librexNormalRedirectsChecks, + librexTorRedirectsChecks: [...redirects.librex.tor], + librexI2pRedirectsChecks: [...redirects.librex.i2p], + librexLokiRedirectsChecks: [...redirects.librex.loki], + }, + () => resolve() + ) }) - }) + ) } let disableSearch, diff --git a/src/assets/javascripts/sendTargets.js b/src/assets/javascripts/sendTargets.js index a52ab6ff..a7b5f20b 100644 --- a/src/assets/javascripts/sendTargets.js +++ b/src/assets/javascripts/sendTargets.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.send = val - sendNormalRedirectsChecks = [...redirects.send.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = sendNormalRedirectsChecks.indexOf(instance) - if (a > -1) sendNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - sendTargetsRedirects: redirects, - sendNormalRedirectsChecks, - sendTorRedirectsChecks: [...redirects.send.tor], - sendI2pRedirectsChecks: [...redirects.send.i2p], - sendLokiRedirectsChecks: [...redirects.send.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.send = val + sendNormalRedirectsChecks = [...redirects.send.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = sendNormalRedirectsChecks.indexOf(instance) + if (a > -1) sendNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + sendTargetsRedirects: redirects, + sendNormalRedirectsChecks, + sendTorRedirectsChecks: [...redirects.send.tor], + sendI2pRedirectsChecks: [...redirects.send.i2p], + sendLokiRedirectsChecks: [...redirects.send.loki], + }, + () => resolve() + ) }) - }) + ) } let disableSendTarget, diff --git a/src/assets/javascripts/tiktok.js b/src/assets/javascripts/tiktok.js index 71f07687..78106a15 100644 --- a/src/assets/javascripts/tiktok.js +++ b/src/assets/javascripts/tiktok.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.proxiTok = val - proxiTokNormalRedirectsChecks = [...redirects.proxiTok.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = proxiTokNormalRedirectsChecks.indexOf(instance) - if (a > -1) proxiTokNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - tiktokRedirects: redirects, - proxiTokNormalRedirectsChecks, - proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], - proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p], - proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.proxiTok = val + proxiTokNormalRedirectsChecks = [...redirects.proxiTok.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = proxiTokNormalRedirectsChecks.indexOf(instance) + if (a > -1) proxiTokNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + tiktokRedirects: redirects, + proxiTokNormalRedirectsChecks, + proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor], + proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p], + proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki], + }, + () => resolve() + ) }) - }) + ) } function initProxiTokCookies(test, from) { diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js index 993c630f..fa103169 100644 --- a/src/assets/javascripts/translate/translate.js +++ b/src/assets/javascripts/translate/translate.js @@ -91,29 +91,34 @@ init() browser.storage.onChanged.addListener(init) function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects = val - simplyTranslateNormalRedirectsChecks = [...redirects.simplyTranslate.normal] - lingvaNormalRedirectsChecks = [...redirects.lingva.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = simplyTranslateNormalCustomRedirects.indexOf(instance) - if (a > -1) simplyTranslateNormalCustomRedirects.splice(a, 1) - - const b = lingvaNormalRedirectsChecks.indexOf(instance) - if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1) - } - browser.storage.local.set({ - translateRedirects: redirects, - simplyTranslateNormalRedirectsChecks, - simplyTranslateTorRedirectsChecks: [...redirects.simplyTranslate.tor], - simplyTranslateI2pRedirectsChecks: [...redirects.simplyTranslate.i2p], - simplyTranslateLokiRedirectsChecks: [...redirects.simplyTranslate.loki], - lingvaNormalRedirectsChecks, - lingvaTorRedirectsChecks: [...redirects.lingva.tor], - lingvaI2pRedirectsChecks: [...redirects.lingva.i2p], - lingvaLokiRedirectsChecks: [...redirects.lingva.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects = val + simplyTranslateNormalRedirectsChecks = [...redirects.simplyTranslate.normal] + lingvaNormalRedirectsChecks = [...redirects.lingva.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = simplyTranslateNormalCustomRedirects.indexOf(instance) + if (a > -1) simplyTranslateNormalCustomRedirects.splice(a, 1) + + const b = lingvaNormalRedirectsChecks.indexOf(instance) + if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1) + } + browser.storage.local.set( + { + translateRedirects: redirects, + simplyTranslateNormalRedirectsChecks, + simplyTranslateTorRedirectsChecks: [...redirects.simplyTranslate.tor], + simplyTranslateI2pRedirectsChecks: [...redirects.simplyTranslate.i2p], + simplyTranslateLokiRedirectsChecks: [...redirects.simplyTranslate.loki], + lingvaNormalRedirectsChecks, + lingvaTorRedirectsChecks: [...redirects.lingva.tor], + lingvaI2pRedirectsChecks: [...redirects.lingva.i2p], + lingvaLokiRedirectsChecks: [...redirects.lingva.loki], + }, + () => resolve() + ) }) - }) + ) } function copyPasteLingvaLocalStorage(test, url, tabId) { diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 7111ad00..2f68dfc2 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], r => { - redirects.nitter = val - nitterNormalRedirectsChecks = [...redirects.nitter.normal] - for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { - let i = nitterNormalRedirectsChecks.indexOf(instance) - if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) - } - browser.storage.local.set({ - twitterRedirects: redirects, - nitterNormalRedirectsChecks, - nitterTorRedirectsChecks: [...redirects.nitter.tor], - nitterI2pRedirectsChecks: [...redirects.nitter.i2p], - nitterLokiRedirectsChecks: [...redirects.nitter.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], r => { + redirects.nitter = val + nitterNormalRedirectsChecks = [...redirects.nitter.normal] + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { + let i = nitterNormalRedirectsChecks.indexOf(instance) + if (i > -1) nitterNormalRedirectsChecks.splice(i, 1) + } + browser.storage.local.set( + { + twitterRedirects: redirects, + nitterNormalRedirectsChecks, + nitterTorRedirectsChecks: [...redirects.nitter.tor], + nitterI2pRedirectsChecks: [...redirects.nitter.i2p], + nitterLokiRedirectsChecks: [...redirects.nitter.loki], + }, + () => resolve() + ) }) - }) + ) } let disableTwitter, diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 81fb181f..5ca5c30b 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -28,26 +28,20 @@ let authenticateBlackList = [] let offlineBlackList = [] async function initBlackList() { return new Promise(resolve => { - browser.storage.local.get([ - "cloudflareBlackList", - "authenticateBlackList", - "offlineBlackList" - ], - r => { - cloudflareBlackList = r.cloudflareBlackList - authenticateBlackList = r.authenticateBlackList - offlineBlackList = r.offlineBlackList - }) + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], r => { + cloudflareBlackList = r.cloudflareBlackList + authenticateBlackList = r.authenticateBlackList + offlineBlackList = r.offlineBlackList + }) if (cloudflareBlackList.length == 0) { - fetch("/instances/blacklist.json") - .then(response => response.text()) - .then(data => { - cloudflareBlackList = JSON.parse(data).cloudflare - authenticateBlackList = JSON.parse(data).authenticate - offlineBlackList = JSON.parse(data).offline - }) + fetch("/instances/blacklist.json") + .then(response => response.text()) + .then(data => { + cloudflareBlackList = JSON.parse(data).cloudflare + authenticateBlackList = JSON.parse(data).authenticate + offlineBlackList = JSON.parse(data).offline + }) } - console.log(offlineBlackList) resolve() }) } @@ -72,11 +66,9 @@ function updateBlackList() { browser.storage.local.set({ cloudflareBlackList: blackList.cloudflare, authenticateBlackList: blackList.authenticate, - offlineBlackList: blackList.offline + offlineBlackList: blackList.offline, }) - cloudflareBlackList = blackList.cloudflare, - authenticateBlackList = blackList.authenticate, - offlineBlackList = blackList.offline + ;(cloudflareBlackList = blackList.cloudflare), (authenticateBlackList = blackList.authenticate), (offlineBlackList = blackList.offline) resolve() }) } @@ -100,42 +92,42 @@ function updateInstances() { await updateBlackList() const instances = JSON.parse(http.responseText) - youtubeHelper.setRedirects({ + await youtubeHelper.setRedirects({ invidious: instances.invidious, piped: instances.piped, pipedMaterial: instances.pipedMaterial, cloudtube: instances.cloudtube, }) - twitterHelper.setRedirects(instances.nitter) - instagramHelper.setRedirects(instances.bibliogram) - redditHelper.setRedirects({ + await twitterHelper.setRedirects(instances.nitter) + await instagramHelper.setRedirects(instances.bibliogram) + await redditHelper.setRedirects({ libreddit: instances.libreddit, teddit: instances.teddit, }) - translateHelper.setRedirects({ + await translateHelper.setRedirects({ simplyTranslate: instances.simplyTranslate, lingva: instances.lingva, }) - searchHelper.setRedirects({ + await searchHelper.setRedirects({ searx: instances.searx, searxng: instances.searxng, whoogle: instances.whoogle, librex: instances.librex, }) - wikipediaHelper.setRedirects(instances.wikiless) - mediumHelper.setRedirects(instances.scribe) - quoraHelper.setRedirects(instances.quetre) - libremdbHelper.setRedirects(instances.libremdb) - sendTargetsHelper.setRedirects(instances.send) - tiktokHelper.setRedirects(instances.proxiTok) - lbryHelper.setRedirects(instances.librarian) - reutersHelper.setRedirects(instances.neuters) - youtubeMusicHelper.setRedirects({ + await wikipediaHelper.setRedirects(instances.wikiless) + await mediumHelper.setRedirects(instances.scribe) + await quoraHelper.setRedirects(instances.quetre) + await libremdbHelper.setRedirects(instances.libremdb) + await sendTargetsHelper.setRedirects(instances.send) + await tiktokHelper.setRedirects(instances.proxiTok) + await lbryHelper.setRedirects(instances.librarian) + await reutersHelper.setRedirects(instances.neuters) + await youtubeMusicHelper.setRedirects({ beatbump: instances.beatbump, hyperpipe: instances.hyperpipe, }) - mapsHelper.setRedirects(instances.facil) - peertubeHelper.setRedirects(instances.simpleertube) + await mapsHelper.setRedirects(instances.facil) + await peertubeHelper.setRedirects(instances.simpleertube) console.info("Successfully updated Instances") resolve(true) @@ -553,7 +545,7 @@ function latency(name, frontend, document, location) { latencyElement.addEventListener("click", async () => { let reloadWindow = () => location.reload() latencyElement.addEventListener("click", reloadWindow) - let key = `${name} Redirects` + let key = `${name}Redirects` browser.storage.local.get(key, r => { let redirects = r[key] const oldHtml = latencyLabel.innerHTML diff --git a/src/assets/javascripts/wikipedia.js b/src/assets/javascripts/wikipedia.js index 2d0f75a1..1e06ed44 100644 --- a/src/assets/javascripts/wikipedia.js +++ b/src/assets/javascripts/wikipedia.js @@ -17,21 +17,26 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects.wikiless = val - wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = wikilessNormalRedirectsChecks.indexOf(instance) - if (a > -1) wikilessNormalRedirectsChecks.splice(a, 1) - } - browser.storage.local.set({ - wikipediaRedirects: redirects, - wikilessNormalRedirectsChecks, - wikilessTorRedirectsChecks: [...redirects.wikiless.tor], - wikilessI2pRedirectsChecks: [...redirects.wikiless.i2p], - wikilessLokiRedirectsChecks: [...redirects.wikiless.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects.wikiless = val + wikilessNormalRedirectsChecks = [...redirects.wikiless.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = wikilessNormalRedirectsChecks.indexOf(instance) + if (a > -1) wikilessNormalRedirectsChecks.splice(a, 1) + } + browser.storage.local.set( + { + wikipediaRedirects: redirects, + wikilessNormalRedirectsChecks, + wikilessTorRedirectsChecks: [...redirects.wikiless.tor], + wikilessI2pRedirectsChecks: [...redirects.wikiless.i2p], + wikilessLokiRedirectsChecks: [...redirects.wikiless.loki], + }, + () => resolve() + ) }) - }) + ) } let disableWikipedia, diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index 32f06b9c..bdb9449a 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -30,45 +30,50 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects = val - invidiousNormalRedirectsChecks = [...redirects.invidious.normal] - pipedNormalRedirectsChecks = [...redirects.piped.normal] - pipedMaterialNormalRedirectsChecks = [...redirects.pipedMaterial.normal] - cloudtubeNormalRedirectsChecks = [...redirects.cloudtube.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = invidiousNormalRedirectsChecks.indexOf(instance) - if (a > -1) invidiousNormalRedirectsChecks.splice(a, 1) - - const b = pipedNormalRedirectsChecks.indexOf(instance) - if (b > -1) pipedNormalRedirectsChecks.splice(b, 1) - - const c = pipedMaterialNormalRedirectsChecks.indexOf(instance) - if (c > -1) pipedMaterialNormalRedirectsChecks.splice(c, 1) - - const d = cloudtubeNormalRedirectsChecks.indexOf(instance) - if (c > -1) cloudtubeNormalRedirectsChecks.splice(d, 1) - } - browser.storage.local.set({ - youtubeRedirects: redirects, - invidiousNormalRedirectsChecks, - invidiousTorRedirectsChecks: [...redirects.invidious.tor], - invidiousI2pRedirectsChecks: [...redirects.invidious.i2p], - invidiousLokiRedirectsChecks: [...redirects.invidious.loki], - pipedNormalRedirectsChecks, - pipedTorRedirectsChecks: [...redirects.piped.tor], - pipedI2pRedirectsChecks: [...redirects.piped.i2p], - pipedLokiRedirectsChecks: [...redirects.piped.loki], - pipedMaterialNormalRedirectsChecks, - pipedMaterialTorRedirectsChecks: [...redirects.pipedMaterial.tor], - pipedMaterialI2pRedirectsChecks: [...redirects.pipedMaterial.i2p], - pipedMaterialLokiRedirectsChecks: [...redirects.pipedMaterial.loki], - cloudtubeNormalRedirectsChecks, - cloudtubeTorRedirectsChecks: [...redirects.cloudtube.tor], - cloudtubeI2pRedirectsChecks: [...redirects.cloudtube.i2p], - cloudtubeLokiRedirectsChecks: [...redirects.cloudtube.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects = val + invidiousNormalRedirectsChecks = [...redirects.invidious.normal] + pipedNormalRedirectsChecks = [...redirects.piped.normal] + pipedMaterialNormalRedirectsChecks = [...redirects.pipedMaterial.normal] + cloudtubeNormalRedirectsChecks = [...redirects.cloudtube.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = invidiousNormalRedirectsChecks.indexOf(instance) + if (a > -1) invidiousNormalRedirectsChecks.splice(a, 1) + + const b = pipedNormalRedirectsChecks.indexOf(instance) + if (b > -1) pipedNormalRedirectsChecks.splice(b, 1) + + const c = pipedMaterialNormalRedirectsChecks.indexOf(instance) + if (c > -1) pipedMaterialNormalRedirectsChecks.splice(c, 1) + + const d = cloudtubeNormalRedirectsChecks.indexOf(instance) + if (c > -1) cloudtubeNormalRedirectsChecks.splice(d, 1) + } + browser.storage.local.set( + { + youtubeRedirects: redirects, + invidiousNormalRedirectsChecks, + invidiousTorRedirectsChecks: [...redirects.invidious.tor], + invidiousI2pRedirectsChecks: [...redirects.invidious.i2p], + invidiousLokiRedirectsChecks: [...redirects.invidious.loki], + pipedNormalRedirectsChecks, + pipedTorRedirectsChecks: [...redirects.piped.tor], + pipedI2pRedirectsChecks: [...redirects.piped.i2p], + pipedLokiRedirectsChecks: [...redirects.piped.loki], + pipedMaterialNormalRedirectsChecks, + pipedMaterialTorRedirectsChecks: [...redirects.pipedMaterial.tor], + pipedMaterialI2pRedirectsChecks: [...redirects.pipedMaterial.i2p], + pipedMaterialLokiRedirectsChecks: [...redirects.pipedMaterial.loki], + cloudtubeNormalRedirectsChecks, + cloudtubeTorRedirectsChecks: [...redirects.cloudtube.tor], + cloudtubeI2pRedirectsChecks: [...redirects.cloudtube.i2p], + cloudtubeLokiRedirectsChecks: [...redirects.cloudtube.loki], + }, + () => resolve() + ) }) - }) + ) } let disableYoutube, diff --git a/src/assets/javascripts/youtubeMusic.js b/src/assets/javascripts/youtubeMusic.js index 797da4d5..f51b4ca9 100644 --- a/src/assets/javascripts/youtubeMusic.js +++ b/src/assets/javascripts/youtubeMusic.js @@ -19,29 +19,34 @@ for (let i = 0; i < frontends.length; i++) { } function setRedirects(val) { - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { - redirects = val - beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] - hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] - for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { - const a = beatbumpNormalRedirectsChecks.indexOf(instance) - if (a > -1) beatbumpNormalRedirectsChecks.splice(a, 1) - - const b = hyperpipeNormalRedirectsChecks.indexOf(instance) - if (b > -1) hyperpipeNormalRedirectsChecks.splice(b, 1) - } - browser.storage.local.set({ - youtubeMusicRedirects: redirects, - beatbumpNormalRedirectsChecks, - beatbumpTorRedirectsChecks: [...redirects.beatbump.tor], - beatbumpI2pRedirectsChecks: [...redirects.beatbump.i2p], - beatbumpLokiRedirectsChecks: [...redirects.beatbump.loki], - hyperpipeNormalRedirectsChecks, - hyperpipeTorRedirectsChecks: [...redirects.hyperpipe.tor], - hyperpipeI2pRedirectsChecks: [...redirects.hyperpipe.i2p], - hyperpipeLokiRedirectsChecks: [...redirects.hyperpipe.loki], + return new Promise(resolve => + browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => { + redirects = val + beatbumpNormalRedirectsChecks = [...redirects.beatbump.normal] + hyperpipeNormalRedirectsChecks = [...redirects.hyperpipe.normal] + for (const instance of [...r.cloudflareBlackList, ...r.offlineBlackList]) { + const a = beatbumpNormalRedirectsChecks.indexOf(instance) + if (a > -1) beatbumpNormalRedirectsChecks.splice(a, 1) + + const b = hyperpipeNormalRedirectsChecks.indexOf(instance) + if (b > -1) hyperpipeNormalRedirectsChecks.splice(b, 1) + } + browser.storage.local.set( + { + youtubeMusicRedirects: redirects, + beatbumpNormalRedirectsChecks, + beatbumpTorRedirectsChecks: [...redirects.beatbump.tor], + beatbumpI2pRedirectsChecks: [...redirects.beatbump.i2p], + beatbumpLokiRedirectsChecks: [...redirects.beatbump.loki], + hyperpipeNormalRedirectsChecks, + hyperpipeTorRedirectsChecks: [...redirects.hyperpipe.tor], + hyperpipeI2pRedirectsChecks: [...redirects.hyperpipe.i2p], + hyperpipeLokiRedirectsChecks: [...redirects.hyperpipe.loki], + }, + () => resolve() + ) }) - }) + ) } let disableYoutubeMusic, diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 077b3da2..b8541ff9 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -30,9 +30,9 @@ Medium
- - - + + +
@@ -237,19 +237,19 @@
- Quora + Quora
- IMDb + IMDb
- Reuters + Reuters
@@ -1774,7 +1774,7 @@
-

Quora

+

Quora


@@ -1881,7 +1881,7 @@
-

IMDb

+

IMDb


@@ -1988,7 +1988,7 @@
-

Reuters

+

Reuters


@@ -3186,4 +3186,4 @@
- + \ No newline at end of file diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index d6824251..61b422f4 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -36,15 +36,16 @@ updateInstancesElement.addEventListener("click", async () => { let exportSettingsElement = document.getElementById("export-settings") function exportSettings() { - browser.storage.local.get(null, result => { + return browser.storage.local.get(null, result => { let resultString = JSON.stringify(result, null, " ") exportSettingsElement.href = "data:application/json;base64," + btoa(encodeURI(resultString)) exportSettingsElement.download = "libredirect-settings.json" + return }) } exportSettings() -document.getElementById("general_page").addEventListener("click", exportSettings) +document.getElementById("general_page").onclick = exportSettings let importSettingsElement = document.getElementById("import-settings") let importSettingsElementText = document.getElementById("import_settings_text") @@ -82,28 +83,28 @@ resetSettings.addEventListener("click", async () => { .then(async data => { browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { browser.storage.local.set({ offlineBlackList: JSON.parse(data).offline }, () => { - browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, async () => { - await generalHelper.initDefaults() - await youtubeHelper.initDefaults() - await youtubeMusicHelper.initDefaults() - await twitterHelper.initDefaults() - await instagramHelper.initDefaults() - await mapsHelper.initDefaults() - await searchHelper.initDefaults() - await translateHelper.initDefaults() - await mediumHelper.initDefaults() - await quoraHelper.initDefaults() - await libremdbHelper.initDefaults() - await reutersHelper.initDefaults() - await redditHelper.initDefaults() - await wikipediaHelper.initDefaults() - await imgurHelper.initDefaults() - await tiktokHelper.initDefaults() - await sendTargetsHelper.initDefaults() - await peertubeHelper.initDefaults() - await lbryHelper.initDefaults() - location.reload() - }) + browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, async () => { + await generalHelper.initDefaults() + await youtubeHelper.initDefaults() + await youtubeMusicHelper.initDefaults() + await twitterHelper.initDefaults() + await instagramHelper.initDefaults() + await mapsHelper.initDefaults() + await searchHelper.initDefaults() + await translateHelper.initDefaults() + await mediumHelper.initDefaults() + await quoraHelper.initDefaults() + await libremdbHelper.initDefaults() + await reutersHelper.initDefaults() + await redditHelper.initDefaults() + await wikipediaHelper.initDefaults() + await imgurHelper.initDefaults() + await tiktokHelper.initDefaults() + await sendTargetsHelper.initDefaults() + await peertubeHelper.initDefaults() + await lbryHelper.initDefaults() + location.reload() + }) }) }) }) diff --git a/src/pages/options/widgets/general.pug b/src/pages/options/widgets/general.pug index e523d5bb..891217ca 100644 --- a/src/pages/options/widgets/general.pug +++ b/src/pages/options/widgets/general.pug @@ -172,19 +172,19 @@ section#general_page.option-block div div img(src="../../../assets/images/quora.png") - x(data-localise="__MSG_quora__") Quora + x() Quora input#quora(type="checkbox") div div img(src="../../../assets/images/imdb.svg") - x(data-localise="__MSG_imdb__") IMDb + x IMDb input#imdb(type="checkbox") div div img(src="../../../assets/images/reuters.svg") - x(data-localise="__MSG_reuters__") Reuters + x Reuters input#reuters(type="checkbox") div diff --git a/src/pages/options/widgets/imdb.pug b/src/pages/options/widgets/imdb.pug index 008e1c00..257d2c1a 100644 --- a/src/pages/options/widgets/imdb.pug +++ b/src/pages/options/widgets/imdb.pug @@ -1,6 +1,6 @@ section#imdb_page.option-block .some-block.option-block - h1(data-localise="__MSG_imdb__") IMDb + h1() IMDb hr .some-block.option-block h4(data-localise="__MSG_enable__") Enable diff --git a/src/pages/options/widgets/quora.pug b/src/pages/options/widgets/quora.pug index 9e45abc9..addfe280 100644 --- a/src/pages/options/widgets/quora.pug +++ b/src/pages/options/widgets/quora.pug @@ -1,6 +1,6 @@ section#quora_page.option-block .some-block.option-block - h1(data-localise="__MSG_quora__") Quora + h1() Quora hr .some-block.option-block h4(data-localise="__MSG_enable__") Enable diff --git a/src/pages/options/widgets/reuters.pug b/src/pages/options/widgets/reuters.pug index 08a37d50..9ed6b3b9 100644 --- a/src/pages/options/widgets/reuters.pug +++ b/src/pages/options/widgets/reuters.pug @@ -1,6 +1,6 @@ section#reuters_page.option-block .some-block.option-block - h1(data-localise="__MSG_reuters__") Reuters + h1() Reuters hr .some-block.option-block h4(data-localise="__MSG_enable__") Enable diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 25f70f48..1c3f6ea2 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -50,15 +50,15 @@
-

Quora

+

Quora

-

IMDb

+

IMDb

-

Reuters

+

Reuters

-

Quora

+

Quora

-

IMDb

+

IMDb

-

Reuters

+

Reuters

diff --git a/src/pages/popup/popup.pug b/src/pages/popup/popup.pug index 7da687cc..cc7fc7a2 100644 --- a/src/pages/popup/popup.pug +++ b/src/pages/popup/popup.pug @@ -58,19 +58,19 @@ mixin services .quora.some-block a.title(href="https://quora.com") img(src="../../assets/images/quora.png") - h4(data-localise="__MSG_quora__") Quora + h4() Quora input.disable-quora(type="checkbox") .imdb.some-block a.title(href="https://imdb.com") img(src="../../assets/images/imdb.svg") - h4(data-localise="__MSG_imdb__") IMDb + h4() IMDb input.disable-imdb(type="checkbox") .reuters.some-block a.title(href="https://reuters.com") img(src="../../assets/images/reuters.svg") - h4(data-localise="__MSG_reuters__") Reuters + h4() Reuters input.disable-reuters(type="checkbox") .peertube.some-block diff --git a/src/pages/widgets/links.pug b/src/pages/widgets/links.pug index c7f8e0a6..37fe9375 100644 --- a/src/pages/widgets/links.pug +++ b/src/pages/widgets/links.pug @@ -44,15 +44,15 @@ mixin links(service) .title img(src="../../../assets/images/quora.png") - a(href="#quora" data-localise="__MSG_quora__") Quora + a(href="#quora" ) Quora .title img(src="../../../assets/images/imdb.svg") - a(href="#imdb" data-localise="__MSG_imdb__") IMDb + a(href="#imdb") IMDb .title img(src="../../../assets/images/reuters.svg") - a(href="#reuters" data-localise="__MSG_reuters__") Reuters + a(href="#reuters") Reuters .title img(src="../../../assets/images/peertube-icon.svg") -- cgit 1.4.1 From d271f48c3c41153ce916de440bfd81207ab0f090 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 7 Aug 2022 22:42:59 +0000 Subject: update instances --- src/instances/blacklist.json | 7 ++++--- src/instances/data.json | 47 +++++++++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index b8b04a01..32a65427 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -56,18 +56,18 @@ "https://nitter:nitter@nitter.nixnet.services" ], "offline": [ - "https://invidious.snopyta.org", "https://tok.habedieeh.re", "https://n.hyperborea.cloud", - "https://de.nttr.stream", "https://twitter.dr460nf1r3.org", "https://nitter.catalyst.sx", "https://bibliogram.snopyta.org", + "https://bibliogram.privacydev.net", "https://libreddit.autarkic.org", - "https://de.leddit.xyz", + "https://lr.vern.cc", "https://reddi.tk", "https://libreddit.notyourcomputer.net", "https://reddit.dr460nf1r3.org", + "https://teddit.froth.zone", "https://translate.dr460nf1r3.org", "https://anon.sx", "https://jsearch.pw", @@ -83,6 +83,7 @@ "https://search.albony.xyz", "https://search.dr460nf1r3.org", "https://whoogle.esmailelbob.xyz", + "https://lbry.bcow.xyz", "https://beatbump.ml", "https://stube.tokhmi.xyz" ] diff --git a/src/instances/data.json b/src/instances/data.json index bc44745b..6f9370b8 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -3,6 +3,7 @@ "normal": [ "https://yewtu.be", "https://vid.puffyan.us", + "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidious.osi.kr", @@ -17,11 +18,10 @@ "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://youtube.076.ne.jp", "https://invidious.weblibre.org", - "https://invidious.snopyta.org", - "https://invidious.esmailelbob.xyz", - "https://invidious.namazso.eu" + "https://youtube.076.ne.jp", + "https://invidious.namazso.eu", + "https://invidious.esmailelbob.xyz" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -42,7 +42,6 @@ "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://il.ax", "https://piped.mha.fi", "https://us-piped.shimul.me", "https://pipedus.palash.dev", @@ -50,6 +49,7 @@ "https://watch.whatever.social", "https://yt.jae.fi", "https://piped.mint.lgbt", + "https://il.ax", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], @@ -409,7 +409,9 @@ "https://quetre.projectsegfau.lt", "https://quetre.esmailelbob.xyz" ], - "tor": [], + "tor": [ + "http://quetre.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + ], "i2p": [], "loki": [] }, @@ -421,7 +423,9 @@ "https://lmdb.tokhmi.xyz", "https://libremdb.esmailelbob.xyz" ], - "tor": [], + "tor": [ + "http://libremdb.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + ], "i2p": [], "loki": [] }, @@ -447,7 +451,8 @@ "tor": [ "http://fyng2tsmzmvxmojzbbwmfnsn2lrcyftf4cw6rk5j2v2huliazud3fjid.onion", "http://xxtbwyb5z5bdvy2f6l2yquu5qilgkjeewno4qfknvb3lkg3nmoklitid.onion", - "http://translate.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion" + "http://translate.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", + "http://simplytranslate.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" ], "i2p": [ "http://kmnkkp4v4ublygtnyq46oacy3qw75nrxxniriuaersumw7bfsm2a.b32.i2p" @@ -477,7 +482,8 @@ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", - "https://northboot.xyz", + "https://search.ashs.club", + "https://search.bingowaves.xyz", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -515,7 +521,9 @@ ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", + "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", + "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", @@ -533,6 +541,7 @@ "https://de.xcxc.ml", "https://etsi.me", "https://jackgoss.xyz", + "https://northboot.xyz", "https://opnxng.com", "https://paulgo.io", "https://priv.au", @@ -542,8 +551,6 @@ "https://saber.tk", "https://search.0relay.com", "https://search.affusio.com", - "https://search.ashs.club", - "https://search.bingowaves.xyz", "https://search.bus-hit.me", "https://search.chemicals-in-the-water.eu", "https://search.disroot.org", @@ -569,6 +576,7 @@ "https://searx.fi", "https://searx.fmac.xyz", "https://searx.gnous.eu", + "https://searx.kujonello.cf", "https://searx.mha.fi", "https://searx.mistli.net", "https://searx.namejeff.xyz", @@ -591,17 +599,17 @@ "https://srx.cosmohub.io", "https://swag.pw", "https://www.gruble.de", + "https://www.higgssearch.com", "https://www.webrats.xyz", "https://xcxc.ml", "https://xo.wtf" ], "tor": [ - "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", - "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", - "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", + "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", + "http://searx.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", @@ -711,7 +719,9 @@ "https://hyperpipe.surge.sh", "https://hyperpipe.esmailelbob.xyz" ], - "tor": [], + "tor": [ + "http://hyperpipe.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + ], "i2p": [], "loki": [] }, @@ -734,6 +744,7 @@ "loki": [] }, "peertube": [ + "https://video.ut0pia.org", "https://kinotu.be", "https://tube.nogafa.org", "https://www.neptube.io", @@ -830,7 +841,6 @@ "https://phijkchu.com", "https://video.lycee-experimental.org", "https://galileo.news", - "https://peertube.otakufarms.com", "https://tube.motuhake.xyz", "https://pt.m0r016.net", "https://hitchtube.fr", @@ -971,7 +981,6 @@ "https://truvitv.com", "https://pt.ilyamikcoder.com", "https://peertube.sensin.eu", - "https://watch.riverside.rocks", "https://sharetube.us", "https://video.sadmin.io", "https://stream.jurnalfm.md", @@ -1300,7 +1309,6 @@ "https://video.gyt.is", "https://peertube.jensdiemer.de", "https://tube.futuretic.fr", - "https://libra.syntazia.org", "https://peertube.beeldengeluid.nl", "https://tv.lumbung.space", "https://peertube.cuatrolibertades.org", @@ -1613,7 +1621,6 @@ "https://peertube.netzbegruenung.de", "https://plextube.nl", "https://tube.opportunis.me", - "https://nanawel-peertube.dyndns.org", "https://tube-strasbourg.beta.education.fr", "https://tube.graz.social", "https://tube-besancon.beta.education.fr", -- cgit 1.4.1 From 7a56715877f122701015acdb038c3c7e9a121379 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Mon, 8 Aug 2022 11:47:25 +0300 Subject: improving the general Class --- src/assets/javascripts/frontend.js | 148 ++++++++++++++++++++++++++++++++----- src/pages/background/background.js | 3 + 2 files changed, 132 insertions(+), 19 deletions(-) diff --git a/src/assets/javascripts/frontend.js b/src/assets/javascripts/frontend.js index 73b864b4..ab71cc0d 100644 --- a/src/assets/javascripts/frontend.js +++ b/src/assets/javascripts/frontend.js @@ -1,33 +1,143 @@ class FrontEnd { - constructor({ name, redirect, frontends, protocols, enable }) { - this.name = name - this.redirect = redirect + constructor({ enable, frontends, frontend, redirect }) { + this.redirects = {} this.enable = enable + this.frontend = frontend + this.protocol = "normal" + this.protocolFallback = true fetch("/instances/data.json") .then(response => response.text()) .then(async data => { - const json = JSON.parse(data) - this.frontends = {} - for (const frontend of frontends) { - this.frontends[frontend] = json[frontend] - for (const protocol of json[frontend]) { - browser.storage.local.set({ - [`${name}_${protocol}_checks`]: json[frontend][protocol], - }) - } + data = JSON.parse(data) + fetch("/instances/blacklist.json") + .then(response => response.text()) + .then(async blackList => { + blackList = JSON.parse(blackList) + for (const frontend in frontends) { + this.redirects[frontend] = {} + + this.redirects[frontend].cookies = [...frontends[frontend].cookies] + + for (const protocol in data[frontend]) { + this.redirects[frontend][protocol] = {} + + this.redirects[frontend][protocol].all = [...data[frontend][protocol]] + + this.redirects[frontend][protocol].custom = [] + + this.redirects[frontend][protocol].checked = [...data[frontend][protocol]] + for (const instance of blackList.cloudflare) { + const a = this.redirects[frontend][protocol].checked.indexOf(instance) + if (a > -1) this.redirects[frontend][protocol].checked.splice(a, 1) + } + for (const instance of blackList.offline) { + const a = this.redirects[frontend][protocol].checked.indexOf(instance) + if (a > -1) this.redirects[frontend][protocol].checked.splice(a, 1) + } + } + } + }) + }) + this.unifyCookies = from => + new Promise(async resolve => { + await init() + const protocolHost = utils.protocolHost(from) + const list = [...this.redirects[this.frontend][this.protocol]] + if (![...list.checked, ...list.custom].includes(protocolHost)) { + resolve() + return + } + for (const cookie of this.redirects[this.frontend].cookies) { + await utils.copyCookie(frontend, protocolHost, [...list.checked, list.custom], cookie) } + resolve(true) }) - browser.storage.local.get(["cloudflareBlackList", "offlineBlackList"], r => {}) - this.protocols = protocols + this.switchInstance = (url, disableOverride) => { + if (!this.enable && !disableOverride) return + + const protocolHost = utils.protocolHost(url) + + const list = [...this.redirects[this.frontend][this.protocol]] + if (!list.all.includes(protocolHost)) return + + let userList = [...list.checked, ...list.custom] + if (userList.length === 0 && this.protocolFallback) userList = [...list.normal.all] + + const i = userList.indexOf(protocolHost) + if (i > -1) userList.splice(i, 1) + if (userList.length === 0) return + + const randomInstance = utils.getRandomInstance(userList) + return `${randomInstance}${url.pathname}${url.search}` + } + + this.redirect = (url, type, initiator, disableOverride) => { + const result = redirect(url, type, initiator, disableOverride) + if (result == "BYPASSTAB") return "BYPASSTAB" + if (result) { + const list = [...this.redirects[this.frontend][this.protocol]] + let userList = [...list.checked, ...list.custom] + const randomInstance = utils.getRandomInstance(userList) + return `${randomInstance}${result.pathname}${result.search}` + } + } + + let init = () => new Promise(async resolve => {}) } - switchInstance(url) {} } let Reddit = new FrontEnd({ - name: "youtube", - redirect: function () {}, - targets: [/^https?:\/{2}(www\.|old\.|np\.|new\.|amp\.|)reddit\.com/, /^https?:\/{2}(i\.|preview\.)redd\.it/], - frontends: ["libreddit", "teddit"], enable: true, + frontends: { + libreddit: { cookies: ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] }, + teddit: { + cookies: [ + "collapse_child_comments", + "domain_instagram", + "domain_twitter", + "domain_youtube", + "flairs", + "highlight_controversial", + "nsfw_enabled", + "post_media_max_height", + "show_upvoted_percentage", + "show_upvotes", + "theme", + "videos_muted", + ], + }, + }, + frontend: "libreddit", + redirect: (url, type, initiator, disableOverride) => { + if (this.enable && !disableOverride) return + + const targets = [/^https?:\/{2}(www\.|old\.|np\.|new\.|amp\.|)reddit\.com/, /^https?:\/{2}(i\.|preview\.)redd\.it/] + if (!targets.some(rx => rx.test(url.href))) return + + if (initiator && all().includes(initiator.origin)) return "BYPASSTAB" + if (!["main_frame", "xmlhttprequest", "other", "image", "media"].includes(type)) return + + const bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/ + if (url.pathname.match(bypassPaths)) return + + const protocolHost = utils.protocolHost(url) + + if (url.host === "i.redd.it") { + if (this.frontend == "libreddit") return `${protocolHost}/img${url.pathname}${url.search}` + if (this.frontend == "teddit") return `${protocolHost}/pics/w:null_${url.pathname.substring(1)}${url.search}` + } else if (url.host === "redd.it") { + // https://redd.it/foo => https://libredd.it/comments/foo + if (this.frontend == "libreddit" && !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)) return `${protocolHost}/comments${url.pathname}${url.search}` + // https://redd.it/foo => https://teddit.net/comments/foo + if (this.frontend == "teddit" && !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)) return `${protocolHost}/comments${url.pathname}${url.search}` + } else if (url.host === "preview.redd.it") { + if (this.frontend == "libreddit") return `${protocolHost}/preview/pre${url.pathname}${url.search}` + if (this.frontend == "teddit") return + } else { + return `${url.href}` + } + }, }) + +export default {} diff --git a/src/pages/background/background.js b/src/pages/background/background.js index c6e9ab7a..39c10052 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -22,8 +22,11 @@ import sendTargetsHelper from "../../assets/javascripts/sendTargets.js" import peertubeHelper from "../../assets/javascripts/peertube.js" import lbryHelper from "../../assets/javascripts/lbry.js" +import frontend from "../../assets/javascripts/frontend.js" + window.browser = window.browser || window.chrome + browser.runtime.onInstalled.addListener(details => { function initDefaults() { fetch("/instances/blacklist.json") -- cgit 1.4.1 From 95d30cb3af0bd09dcc9afb5ea508a60139777812 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 9 Aug 2022 10:15:59 +0300 Subject: Handle youtu.be for FreeTube by @mittermichal https://github.com/libredirect/libredirect/pull/393 --- src/assets/javascripts/youtube/youtube.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index bdb9449a..c3442246 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -342,6 +342,7 @@ function redirect(url, type, initiator, disableOverride) { case "yatte": return url.href.replace(/^https?:\/{2}/, "yattee://") case "freetube": + if (url.host === "youtu.be") return `freetube://https://youtube.com/watch?v=${url.pathname.slice(1)}&${url.search.slice(1)}` return `freetube://https://youtube.com${url.pathname}${url.search}` } } -- cgit 1.4.1 From 37264f8aa865014beff07421b5b6bccd942bf84a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 10 Aug 2022 22:41:39 +0000 Subject: update instances --- src/instances/blacklist.json | 9 +-------- src/instances/data.json | 35 ++++++++++++++--------------------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 32a65427..4dd94cff 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -7,7 +7,6 @@ "https://piped.mha.fi", "https://us-piped.shimul.me", "https://pipedus.palash.dev", - "https://piped.waffle.wiki", "https://watch.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", @@ -23,7 +22,6 @@ "https://bib.actionsack.com", "https://libreddit.domain.glass", "https://r.nf", - "https://lr.oversold.host", "https://libreddit.hu", "https://lr.stilic.ml", "https://reddi.tk", @@ -44,7 +42,6 @@ "https://translate.dr460nf1r3.org", "https://searx.org", "https://searx.run", - "https://search.albony.xyz", "https://search.garudalinux.org", "https://search.dr460nf1r3.org", "https://search.wef.lol", @@ -57,17 +54,14 @@ ], "offline": [ "https://tok.habedieeh.re", - "https://n.hyperborea.cloud", "https://twitter.dr460nf1r3.org", "https://nitter.catalyst.sx", "https://bibliogram.snopyta.org", - "https://bibliogram.privacydev.net", + "https://insta.tromdienste.de", "https://libreddit.autarkic.org", - "https://lr.vern.cc", "https://reddi.tk", "https://libreddit.notyourcomputer.net", "https://reddit.dr460nf1r3.org", - "https://teddit.froth.zone", "https://translate.dr460nf1r3.org", "https://anon.sx", "https://jsearch.pw", @@ -80,7 +74,6 @@ "https://searx.fmac.xyz", "https://searxng.au/searx", "https://www.webrats.xyz", - "https://search.albony.xyz", "https://search.dr460nf1r3.org", "https://whoogle.esmailelbob.xyz", "https://lbry.bcow.xyz", diff --git a/src/instances/data.json b/src/instances/data.json index 6f9370b8..c95d3d1a 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -45,11 +45,11 @@ "https://piped.mha.fi", "https://us-piped.shimul.me", "https://pipedus.palash.dev", - "https://piped.waffle.wiki", "https://watch.whatever.social", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://il.ax", + "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt" ], @@ -83,8 +83,8 @@ "normal": [ "https://proxitok.herokuapp.com", "https://proxitok.pussthecat.org", - "https://proxitok.privacydev.net", - "https://tok.habedieeh.re" + "https://tok.habedieeh.re", + "https://proxitok.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -133,7 +133,6 @@ "https://nitter.it", "https://twitter.censors.us", "https://nitter.grimneko.de", - "https://n.hyperborea.cloud", "https://nitter.ca", "https://twitter.076.ne.jp", "https://nitter.fly.dev", @@ -154,7 +153,6 @@ "https://nitter.spaceint.fr", "https://twtr.bch.bar", "https://nitter.privacy.com.de", - "https://nitter.mastodon.pro", "https://nitter.notraxx.ch", "https://nitter.poast.org", "https://nitter.bird.froth.zone", @@ -170,7 +168,6 @@ "https://nitter.kylrth.com", "https://nitter.foss.wtf", "https://nitter.priv.pw", - "https://nt.vern.cc", "https://nitter.wef.lol", "https://nitter.tokhmi.xyz", "https://nitter.catalyst.sx", @@ -229,7 +226,6 @@ "https://insta.tromdienste.de", "https://ig.tokhmi.xyz", "https://ig.beparanoid.de", - "https://bibliogram.privacydev.net", "https://bibliogram.priv.pw", "https://ig.funami.tech", "https://bib.actionsack.com" @@ -517,13 +513,13 @@ "https://suche.uferwerk.org", "https://sx.catgirl.cloud", "https://timdor.noip.me/searx", + "https://xcxc.ml", "https://searx.roflcopter.fr" ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", - "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", + "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", @@ -593,6 +589,7 @@ "https://searxng.au/searx", "https://searxng.tordenskjold.de", "https://searxng.zackptg5.com", + "https://searxvm.com", "https://serx.ml", "https://sh0.it", "https://soek.allesbeste.com", @@ -601,13 +598,13 @@ "https://www.gruble.de", "https://www.higgssearch.com", "https://www.webrats.xyz", - "https://xcxc.ml", "https://xo.wtf" ], "tor": [ + "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", - "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", @@ -643,16 +640,19 @@ "librex": { "normal": [ "https://librex.beparanoid.de", + "https://librex.extravi.dev", "https://search.davidovski.xyz", "https://search.funami.tech", "https://librex.catalyst.sx" ], "tor": [ "http://librex.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", + "http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion", "http://librex.so2mpiyfo4cje7bof5v52y3cvjyo2haxpqfvut4sr6gj2ul4mddx2jid.onion" ], "i2p": [ - "http://fboseyskrqpi6yjiifvz4ryuoiswjezkqsfxfkm2vmbuhehbpr7q.b32.i2p" + "http://ljluyti43556bflsucfkhegelemo6guchmq4g7ebxuentomupxoa.b32.i2p", + "http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p" ], "loki": [] }, @@ -744,6 +744,8 @@ "loki": [] }, "peertube": [ + "https://jzqk.org", + "https://tube.xsoftware.it", "https://video.ut0pia.org", "https://kinotu.be", "https://tube.nogafa.org", @@ -761,7 +763,6 @@ "https://tube-cycle-3.apps.education.fr", "https://video.manicphase.me", "https://tube.emy.plus", - "https://v.bearvideo.win", "https://tubulus.openlatin.org", "https://peertube.securetown.top", "https://tv.datamol.org", @@ -795,14 +796,12 @@ "https://video.uriopss-pdl.fr", "https://pt.bolapara.mywire.org", "https://ptube.ranranhome.info", - "https://vidid.pl", "https://video.3cmr.fr", "https://tube.die-rote-front.de", "https://peertube.miguelcr.me", "https://video.thinkof.name", "https://nekofans.tv", "https://video.comun.al", - "https://peertube.nrsk.no", "https://video.occm.cc", "https://peertube.viviers-fibre.net", "https://tube-action-educative.apps.education.fr", @@ -831,7 +830,6 @@ "https://see.vtopia.live", "https://peertube.letoine.fr", "https://tube-enseignement-professionnel.apps.education.fr", - "https://socpeertube.ru", "https://videos.laliguepaysdelaloire.org", "https://quantube.win", "https://twctube.twc-zone.eu", @@ -869,7 +867,6 @@ "https://peertube.chaunchy.com", "https://tube.vrpnet.org", "https://video.tii.space", - "https://peertube.inubo.ch", "https://nightshift.minnix.dev", "https://tube.friloux.me", "https://peertube.virtual-assembly.org", @@ -958,7 +955,6 @@ "https://videos.sadx.moe", "https://pt.nospy.net", "https://yhwh.tube", - "https://peerlook.ru", "https://tube.kicou.info", "https://video.aqr.af", "https://videos-passages.huma-num.fr", @@ -1034,7 +1030,6 @@ "https://poast.tv", "https://testube.distrilab.fr", "https://peertube.rse43.com", - "https://libremedia.video", "https://vid.lelux.fi", "https://v.wolfskaempf.de", "https://peertube.chevro.fr", @@ -1326,7 +1321,6 @@ "https://peertube.radres.xyz", "https://darkvapor.nohost.me", "https://tube.chaoszone.tv", - "https://media.over-world.org", "https://tube.avensio.de", "https://peertube.klaewyss.fr", "https://sender-fm.veezee.tube", @@ -1649,7 +1643,6 @@ "https://mplayer.demouliere.eu", "https://video.liberta.vip", "https://peertube.gcfamily.fr", - "https://video.ploud.fr", "https://tube.plaf.fr", "https://tube.nah.re", "https://dreiecksnebel.alex-detsch.de", -- cgit 1.4.1 From d375ef8f4b338628e0031f9c5440e04f763ec132 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 13 Aug 2022 22:42:30 +0000 Subject: update instances --- src/instances/blacklist.json | 13 ++++++++--- src/instances/data.json | 52 ++++++++++++++++++++------------------------ 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 4dd94cff..0c9a8502 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -8,6 +8,7 @@ "https://us-piped.shimul.me", "https://pipedus.palash.dev", "https://watch.whatever.social", + "https://cringe.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", "https://notabird.site", @@ -37,7 +38,9 @@ "https://teddit.encrypted-data.xyz", "https://teddit.garudalinux.org", "https://tedd.it", + "https://wiki.privacytools.io", "https://wiki.604kph.xyz", + "https://wiki.privacytools.io", "https://lingva.garudalinux.org", "https://translate.dr460nf1r3.org", "https://searx.org", @@ -47,21 +50,26 @@ "https://search.wef.lol", "https://i.actionsack.com", "https://rimgo.encrypted-data.xyz", - "https://beatbump.ml" + "https://beatbump.ml", + "https://listen.whatever.social" ], "authenticate": [ "https://nitter:nitter@nitter.nixnet.services" ], "offline": [ + "https://invidious.kavin.rocks", + "https://invidious.osi.kr", "https://tok.habedieeh.re", "https://twitter.dr460nf1r3.org", "https://nitter.catalyst.sx", + "https://twt.funami.tech", "https://bibliogram.snopyta.org", - "https://insta.tromdienste.de", + "https://ig.beparanoid.de", "https://libreddit.autarkic.org", "https://reddi.tk", "https://libreddit.notyourcomputer.net", "https://reddit.dr460nf1r3.org", + "https://translate.riverside.rocks", "https://translate.dr460nf1r3.org", "https://anon.sx", "https://jsearch.pw", @@ -76,7 +84,6 @@ "https://www.webrats.xyz", "https://search.dr460nf1r3.org", "https://whoogle.esmailelbob.xyz", - "https://lbry.bcow.xyz", "https://beatbump.ml", "https://stube.tokhmi.xyz" ] diff --git a/src/instances/data.json b/src/instances/data.json index c95d3d1a..eb987ff1 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -4,9 +4,7 @@ "https://yewtu.be", "https://vid.puffyan.us", "https://invidious.snopyta.org", - "https://invidious.kavin.rocks", "https://inv.riverside.rocks", - "https://invidious.osi.kr", "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.flokinet.to", @@ -18,10 +16,12 @@ "https://invidious.nerdvpn.de", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://invidious.weblibre.org", "https://youtube.076.ne.jp", + "https://invidious.weblibre.org", + "https://invidious.kavin.rocks", "https://invidious.namazso.eu", - "https://invidious.esmailelbob.xyz" + "https://invidious.esmailelbob.xyz", + "https://invidious.osi.kr" ], "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", @@ -50,8 +50,7 @@ "https://piped.mint.lgbt", "https://il.ax", "https://piped.privacy.com.de", - "https://piped.esmailelbob.xyz", - "https://piped.projectsegfau.lt" + "https://piped.esmailelbob.xyz" ], "tor": [], "i2p": [], @@ -84,7 +83,9 @@ "https://proxitok.herokuapp.com", "https://proxitok.pussthecat.org", "https://tok.habedieeh.re", - "https://proxitok.esmailelbob.xyz" + "https://proxitok.esmailelbob.xyz", + "https://cringe.whatever.social", + "https://proxitok.dhusch.de" ], "tor": [], "i2p": [], @@ -181,7 +182,8 @@ "https://nederland.unofficialbird.com", "https://uk.unofficialbird.com", "https://n.l5.ca", - "https://nitter.slipfox.xyz" + "https://nitter.slipfox.xyz", + "https://nitter.soopy.moe" ], "tor": [ "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -343,7 +345,8 @@ "https://i.opnxng.com", "https://teddit.tokhmi.xyz", "https://teddit.garudalinux.org", - "https://tedd.it" + "https://tedd.it", + "https://wiki.privacytools.io" ], "tor": [ "http://snoo.ioensistjs7wd746zluwixvojbbkxhr37lepdvwtdfeav673o64iflqd.onion", @@ -366,18 +369,22 @@ "https://wikiless.tiekoetter.com", "https://wikiless.esmailelbob.xyz", "https://wiki.slipfox.xyz", - "https://wikiless.funami.tech" + "https://wikiless.funami.tech", + "https://wl.vern.cc", + "https://wiki.privacytools.io" ], "tor": [ "http://dj2tbh2nqfxyfmvq33cjmhuw7nb6am7thzd3zsjvizeqf374fixbrxyd.onion", "http://ybgg2evrcdz37y2qes23ff3wjqjdn33tthgoagi76vhxytu4mpxiz5qd.onion", "http://wikiless.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion" + "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion", + "http://wl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" ], "i2p": [ "http://wikiless.i2p", "http://hflqp2ejxygpj6cdwo3ogfieqmxw3b56w7dblt7bor2ltwk6kcfa.b32.i2p", - "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p" + "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p", + "http://vernesciy2defjsputrjrv6pa5ll6qzrckfffi5lgkumstdojyga.b32.i2p" ], "loki": [] }, @@ -478,8 +485,6 @@ "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", - "https://search.ashs.club", - "https://search.bingowaves.xyz", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -513,12 +518,10 @@ "https://suche.uferwerk.org", "https://sx.catgirl.cloud", "https://timdor.noip.me/searx", - "https://xcxc.ml", "https://searx.roflcopter.fr" ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", @@ -563,6 +566,7 @@ "https://search.unlocked.link", "https://search.vidhukant.xyz", "https://search.zzls.xyz", + "https://searx.baczek.me", "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", @@ -598,6 +602,7 @@ "https://www.gruble.de", "https://www.higgssearch.com", "https://www.webrats.xyz", + "https://xcxc.ml", "https://xo.wtf" ], "tor": [ @@ -684,7 +689,7 @@ "https://lbry.bcow.xyz", "https://odysee.076.ne.jp", "https://librarian.pussthecat.org", - "https://lbry.mutahar.rocks", + "https://lbry.projectsegfau.lt", "https://librarian.esmailelbob.xyz", "https://lbry.vern.cc", "https://lbry.slipfox.xyz" @@ -717,7 +722,8 @@ "hyperpipe": { "normal": [ "https://hyperpipe.surge.sh", - "https://hyperpipe.esmailelbob.xyz" + "https://hyperpipe.esmailelbob.xyz", + "https://listen.whatever.social" ], "tor": [ "http://hyperpipe.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" @@ -754,7 +760,6 @@ "https://pcbu.nl", "https://soberania.tv", "https://pire.artisanlogiciel.net", - "https://trutube.xyz", "https://tube-test.apps.education.fr", "https://tube-sciences-technologies.apps.education.fr", "https://stream.conesphere.cloud", @@ -767,12 +772,10 @@ "https://peertube.securetown.top", "https://tv.datamol.org", "https://video.graine-pdl.org", - "https://tube.zee.li", "https://tube-cycle-2.apps.education.fr", "https://mikeclips.net", "https://tube.s1gm4.eu", "https://videos.keyedlimepie.org", - "https://video.cpn.so", "https://video.davduf.net", "https://tube.oldkid.digital", "https://tube.fofoca.eu", @@ -783,7 +786,6 @@ "https://media.theplattform.net", "https://peertube.offerman.com", "https://v.lastorder.xyz", - "https://video.eradicatinglove.xyz", "https://peertube.thele.me", "https://video.schnitzler.one", "https://tube.cybershock.life", @@ -812,7 +814,6 @@ "https://tube.hunterjozwiak.com", "https://tube-numerique-educatif.apps.education.fr", "https://tube.itsg.host", - "https://tube.valinor.fr", "https://lucarne.balsamine.be", "https://peertube.suranyami.com", "https://video.ados.accoord.fr", @@ -846,7 +847,6 @@ "https://peertube.ctrl-c.liu.se", "https://peertube.live", "https://video.slipfox.xyz", - "https://pt.vern.cc", "https://vnop.org", "https://videos.cassidypunchmachine.com", "https://tv1.gomntu.space", @@ -914,7 +914,6 @@ "https://cliptube.org", "https://tube.tr4sk.me", "https://videos.campdarling.com", - "https://video.mikka.md", "https://www.aktion-nordost.tv", "https://tube.rooty.fr", "https://tube.dnet.one", @@ -986,7 +985,6 @@ "https://tv.suwerenni.org", "https://tube.revertron.com", "https://tube.erzbistum-hamburg.de", - "https://video.germanische-heilkunde.at", "https://views.southfox.me", "https://vide.oxel.me", "https://video.mttv.it", @@ -1618,7 +1616,6 @@ "https://tube-strasbourg.beta.education.fr", "https://tube.graz.social", "https://tube-besancon.beta.education.fr", - "https://vid.garwood.io", "https://kolektiva.media", "https://peertube.ichigo.everydayimshuflin.com", "https://video.lundi.am", @@ -1730,7 +1727,6 @@ "https://peertube.makotoworkshop.org", "https://peertube.serveur.slv-valbonne.fr", "https://video.netsyms.com", - "https://video.writeas.org", "https://videos.adhocmusic.com", "https://vid.y-y.li", "https://diode.zone", -- 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(-) 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 b62c79adf867d4fe9401d82d22c4a00b3e292da7 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 14 Aug 2022 15:11:50 +0300 Subject: Removed embedded only https://github.com/libredirect/libredirect/issues/410 --- src/assets/javascripts/lbry.js | 2 +- src/assets/javascripts/twitter.js | 1 - src/assets/javascripts/youtube/youtube.js | 3 +-- src/pages/background/background.js | 3 +-- src/pages/options/index.html | 3 --- src/pages/options/widgets/lbry.pug | 1 - src/pages/options/widgets/twitter.pug | 1 - src/pages/options/widgets/youtube.pug | 1 - 8 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/assets/javascripts/lbry.js b/src/assets/javascripts/lbry.js index 5819d132..698517a9 100644 --- a/src/assets/javascripts/lbry.js +++ b/src/assets/javascripts/lbry.js @@ -152,7 +152,7 @@ function redirect(url, type, initiator, disableOverride) { if (disableLbryTargets && !disableOverride) return if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) return if (!targets.some(rx => rx.test(url.href))) return - if ((type == "main_frame" && lbryRedirectType == "sub_frame") || (type == "sub_frame" && lbryRedirectType == "main_frame")) return + if (type == "sub_frame" && lbryRedirectType == "main_frame") return const instancesList = getInstancesList() switch (type) { diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 2f68dfc2..5704d259 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -97,7 +97,6 @@ function redirect(url, type, initiator, disableOverride) { if (!targets.some(rx => rx.test(url.href))) return if (url.pathname.split("/").includes("home")) return if (initiator && all().includes(initiator.origin)) return "BYPASSTAB" - if (twitterRedirectType == "sub_frame" && type == "main_frame") return if (twitterRedirectType == "main_frame" && type != "main_frame") return let instancesList = [] diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index c3442246..7b215704 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -327,14 +327,13 @@ function getInstanceList(type) { return instancesList } -function redirect(url, type, initiator, disableOverride) { +function redirect(url, type, tabId, initiator, disableOverride) { if (disableYoutube && !disableOverride) return if (!targets.some(rx => rx.test(url.href))) return if (initiator && all().includes(initiator.origin)) return "BYPASSTAB" if (type != ("main_frame" || "sub_frame")) return if (url.pathname.match(/iframe_api/) || url.pathname.match(/www-widgetapi/)) return // Don't redirect YouTube Player API. - if (onlyEmbeddedVideo == "onlyEmbedded" && type == "main_frame") return if (onlyEmbeddedVideo == "onlyNotEmbedded" && type == "sub_frame") return if (type == "main_frame") { diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 39c10052..7e37bade 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -26,7 +26,6 @@ import frontend from "../../assets/javascripts/frontend.js" window.browser = window.browser || window.chrome - browser.runtime.onInstalled.addListener(details => { function initDefaults() { fetch("/instances/blacklist.json") @@ -90,7 +89,7 @@ browser.webRequest.onBeforeRequest.addListener( } let newUrl = youtubeMusicHelper.redirect(url, details.type) - if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, details.tabId, initiator) if (!newUrl) newUrl = twitterHelper.redirect(url, details.type, initiator) if (!newUrl) newUrl = instagramHelper.redirect(url, details.type, initiator) if (!newUrl) newUrl = mapsHelper.redirect(url, initiator) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index b8541ff9..af417403 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -312,7 +312,6 @@

Redirect Type

@@ -925,7 +924,6 @@

Redirect Type

@@ -2220,7 +2218,6 @@

Redirect Type

diff --git a/src/pages/options/widgets/lbry.pug b/src/pages/options/widgets/lbry.pug index e4278438..327c938b 100644 --- a/src/pages/options/widgets/lbry.pug +++ b/src/pages/options/widgets/lbry.pug @@ -16,7 +16,6 @@ section#lbry_page.option-block h4(data-localise="__MSG_redirectType__") Redirect Type select#lbry-redirect_type option(value="both" data-localise="__MSG_both__") both - option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded #librarian diff --git a/src/pages/options/widgets/twitter.pug b/src/pages/options/widgets/twitter.pug index 6e610545..137e1efb 100644 --- a/src/pages/options/widgets/twitter.pug +++ b/src/pages/options/widgets/twitter.pug @@ -10,7 +10,6 @@ section#twitter_page.option-block h4(data-localise="__MSG_redirectType__") Redirect Type select#twitter-redirect_type option(value="both" data-localise="__MSG_both__") both - option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded #nitter diff --git a/src/pages/options/widgets/youtube.pug b/src/pages/options/widgets/youtube.pug index 33a43c34..66faa60a 100644 --- a/src/pages/options/widgets/youtube.pug +++ b/src/pages/options/widgets/youtube.pug @@ -29,7 +29,6 @@ section#youtube_page.option-block h4(data-localise="__MSG_redirectType__") Redirect Type select#youtube-redirect_type option(value="both" data-localise="__MSG_both__") both - option(value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__") Only Embedded option(value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded #invidious -- cgit 1.4.1 From 87d68cb662ca1d4ca436e8a10e101900b59c2bd3 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 14 Aug 2022 15:34:08 +0300 Subject: removed ref_src and ref_url from twitter urls https://github.com/libredirect/libredirect/issues/395 --- src/assets/javascripts/twitter.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/assets/javascripts/twitter.js b/src/assets/javascripts/twitter.js index 5704d259..eca8219f 100644 --- a/src/assets/javascripts/twitter.js +++ b/src/assets/javascripts/twitter.js @@ -110,13 +110,27 @@ function redirect(url, type, initiator, disableOverride) { const randomInstance = utils.getRandomInstance(instancesList) // https://pbs.twimg.com/profile_images/648888480974508032/66_cUYfj_400x400.jpg + + let search = new URLSearchParams(url.search) + + search.delete("ref_src") + search.delete("ref_url") + + search = search.toString() + if (search !== "") search = `?${search}` + if (url.host.split(".")[0] === "pbs" || url.host.split(".")[0] === "video") { - const [, id, format, extra] = url.search.match(/(.*)\?format=(.*)&(.*)/) + const [, id, format, extra] = search.match(/(.*)\?format=(.*)&(.*)/) const query = encodeURIComponent(`${id}.${format}?${extra}`) - return `${randomInstance}/pic${url.pathname}${query}` - } else if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${url.search}` - else if (url.host == "t.co") return `${randomInstance}/t.co${url.pathname}` - else return `${randomInstance}${url.pathname}${url.search}` + return `${randomInstance}/pic${search}${query}` + } + if (url.pathname.split("/").includes("tweets")) { + return `${randomInstance}${url.pathname.replace("/tweets", "")}${search}` + } + if (url.host == "t.co") { + return `${randomInstance}/t.co${url.pathname}` + } + return `${randomInstance}${url.pathname}${search}` } function reverse(url) { -- cgit 1.4.1 From c5330235469b730b1bd575f17c6aa8eb7705f63a Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 6 Sep 2022 19:31:50 +0100 Subject: Finish initial config.json draft --- src/config/config.json | 381 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 360 insertions(+), 21 deletions(-) diff --git a/src/config/config.json b/src/config/config.json index d918a0ad..9051d118 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,6 +1,6 @@ { "networks": { - "normal": { + "clearnet": { "url": "org", "name": "Clearnet" }, @@ -22,13 +22,11 @@ "frontends": { "invidious": { "preferences": { - "method": "cookies", "cookies": ["PREFS"] } }, "piped": { "preferences": { - "method": "localstorage", "localstorage": [ "bufferGoal", "comments", @@ -53,30 +51,25 @@ }, "pipedMaterial": { "preferences": { - "method": "localstorage", "localstorage": ["PREFERENCES"] } }, "cloudtube": { "preferences": { - "method": "token", "token": "token", "fetchEndpoint": "/api/settings", "setEndpoint": "/settings" } } }, - "singleInstanceFrontends": { - "freetube": {}, - "yatte": {} - }, + "singleInstanceFrontends": ["freetube", "yatte"], "targets": [ - "/^https?:\\/{2}(www.|music.|m.|)youtube.com(\\/.*|$)/", - "/^https?:\\/{2}img.youtube.com\\/vi\\/.*\\/..*/", - "/^https?:\\/{2}(i|s).ytimg.com\\/vi\\/.*\\/..*/", - "/^https?:\\/{2}(www.|music.|)youtube.com\\/watch?v=..*/", - "/^https?:\\/{2}youtu.be\\/..*/", - "/^https?:\\/{2}(www.|)(youtube|youtube-nocookie).com\\/embed\\/..*/" + "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\/.*|$)", + "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", + "^https?:\\/{2}youtu\\.be\\/..*", + "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" ], "name": "Youtube", "defaults": { @@ -86,13 +79,359 @@ "youtubeFrontend": "invidious", "youtubeEmbedFrontend": "invidious" }, - "youtubeMusic": { - "frontends": { - "beatbump": {}, - "hyperpipe": {} + "imageType": "png" + }, + "youtubeMusic": { + "frontends": { + "beatbump": {}, + "hyperpipe": {} + }, + "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], + "name": "YT Music", + "defaults": { + "disableYoutubeMusic": false, + "youtubeMusicFrontend": "beatbump" + }, + "imageType": "png" + }, + "twitter": { + "frontends": { + "nitter": { + "preferences": { + "cookies": [ + "theme", + "infiniteScroll", + "stickyProfile", + "bidiSupport", + "hideTweetStats", + "hideBanner", + "hidePins", + "hideReplies", + "squareAvatars", + "mp4Playback", + "hlsPlayback", + "proxyVideos", + "muteVideos", + "autoplayGifs", + "replaceInstagram", + "replaceReddit", + "replaceTwitter", + "replaceYouTube" + ] + } + } + }, + "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], + "name": "Twitter", + "defaults": { + "disableTwitter": false, + "twitterRedirectType": "both" + }, + "imageType": "png" + }, + "instagram": { + "frontends": { + "bibliogram": { + "preferences": { + "token": "token", + "fetchEndpoint": "/settings.json", + "setEndpoint": "/applysettings" + } + } + }, + "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], + "name": "Instagram", + "defaults": { + "disableInstagram": false + }, + "imageType": "png" + }, + "tiktok": { + "frontends": { + "proxiTok": {} + }, + "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], + "name": "TikTok", + "defaults": { + "disableTiktok": false + }, + "imageType": "png" + }, + "reddit": { + "frontends": { + "libreddit": { + "preferences": { + "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] + } + }, + "teddit": { + "preferences": { + "cookies": [ + "collapse_child_comments", + "domain_instagram", + "domain_twitter", + "domain_youtube", + "flairs", + "highlight_controversial", + "nsfw_enabled", + "post_media_max_height", + "show_upvoted_percentage", + "show_upvotes", + "theme", + "videos_muted" + ] + } + } + }, + "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], + "name": "Reddit", + "defaults": { + "disableReddit": false, + "redditFrontend": "libreddit" + }, + "imageType": "png" + }, + "imgur": { + "frontends": { + "rimgo": { + "preferences": {} + } + }, + "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], + "name": "Imgur", + "defaults": { "disableImgur": false }, + "imageType": "png" + }, + "wikipedia": { + "frontends": { + "wikiless": { + "preferences": { + "cookies": ["theme", "default_lang"] + } + } + }, + "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], + "name": "Wikipedia", + "defaults": { "disableWikipedia": true }, + "imageType": "svg" + }, + "medium": { + "frontends": { + "scribe": { + "preferences": {} + } + }, + "targets": [ + "(?:.*\\.)*(? Date: Wed, 7 Sep 2022 18:05:18 +0100 Subject: Started work on services.js --- src/assets/javascripts/services.js | 105 +++++ src/config/config.json | 874 ++++++++++++++++++------------------- src/pages/background/background.js | 5 + 3 files changed, 547 insertions(+), 437 deletions(-) create mode 100644 src/assets/javascripts/services.js diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js new file mode 100644 index 00000000..cf193e30 --- /dev/null +++ b/src/assets/javascripts/services.js @@ -0,0 +1,105 @@ +window.browser = window.browser || window.chrome + +import utils from "./utils.js" + +let config + +function getConfig() { + return new Promise(async resolve => { + fetch("/config/config.json") + .then(response => response.text()) + .then(data => { + config = JSON.parse(data) + }) + resolve() + }) +} + +let redirects = {} +let disabled, curNetwork, networkFallback, redirectType + +function init() { + return new Promise(async resolve => { + browser.storage.local.get(["network", "networkFallback"], r => { + curNetwork = r.network + networkFallback = r.networkFallback + }) + //cur = current + getConfig() + for (service in config.services) { + redirects = {} + browser.storage.local.get([`disable${camelCase(service)}`, `${service}Redirects`, `${service}RedirectType,`, `${service}Frontend`], r => { + disabled = r["disable" + camelCase(service)] + redirects = r[service + "Redirects"] + frontend = r[service + "Frontend"] + }) + for (frontend in config[service].frontends) { + redirects[frontend] = {} + for (network in config.networks) { + browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { + redirects[frontend][network] = [...r[frontend + camelCase(network) + "RedirectsChecks"], ...r[frontend + camelCase(network) + "CustomRedirects"]] + }) + } + } + } + resolve() + }) +} + +init() +browser.storage.onChanged.addListener(init) + +function redirect(url, type, initiator) { + if (url.pathname == "/") return + for (curService in config.services) { + if (disabled && !disableOverride) continue + if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) continue + //if (!targets.some(rx => rx.test(url.href))) continue + if (!target.test(url)) continue + if (type != redirectType && type != "both") continue + let instanceList = redirects[frontend][curNetwork] + if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet + if (instanceList.length === 0) return + const randomInstance = utils.getRandomInstance(instanceList) + return `${randomInstance}${url.pathname}${url.search}` + } +} + +function initDefaults() { + return new Promise(resolve => { + fetch("/instances/data.json") + .then(response => response.text()) + .then(data => { + let dataJson = JSON.parse(data) + redirects = dataJson + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { + for (service in config.services) { + for (frontend in service.frontends) { + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { + let i = redirects[frontend]["clearnet"].indexOf(instance) + if (i > -1) redirects[frontend]["clearnet"].splice(i, 1) + } + browser.storage.local.set({ + ["disable" + camelCase(service)]: false, + [service + "Redirects"]: redirects, + [service + "RedirectType"]: "both", + }) + for (frontend in service.frontends) { + for (protocol in config.protocols) { + browser.storage.local.set({ + [frontend + camelCase(protocol) + "RedirectsChecks"]: [...redirects[frontend][protocol]], + [frontend + camelCase(protocol) + "CustomRedirects"]: [], + }) + } + } + ;() => resolve() + } + } + }) + }) + }) +} + +export default { + redirect, +} diff --git a/src/config/config.json b/src/config/config.json index 9051d118..db991772 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,437 +1,437 @@ -{ - "networks": { - "clearnet": { - "url": "org", - "name": "Clearnet" - }, - "tor": { - "url": "onion", - "name": "Tor" - }, - "i2p": { - "url": "i2p", - "name": "I2P" - }, - "loki": { - "url": "loki", - "name": "Lokinet" - } - }, - "services": { - "youtube": { - "frontends": { - "invidious": { - "preferences": { - "cookies": ["PREFS"] - } - }, - "piped": { - "preferences": { - "localstorage": [ - "bufferGoal", - "comments", - "disableLBRY", - "enabledCodecs", - "hl", - "homepage", - "instance", - "listen", - "minimizeDescription", - "playerAutoPlay", - "proxyLBRY", - "quality", - "region", - "selectedSkip", - "sponsorblock", - "theme", - "volume", - "watchHistory" - ] - } - }, - "pipedMaterial": { - "preferences": { - "localstorage": ["PREFERENCES"] - } - }, - "cloudtube": { - "preferences": { - "token": "token", - "fetchEndpoint": "/api/settings", - "setEndpoint": "/settings" - } - } - }, - "singleInstanceFrontends": ["freetube", "yatte"], - "targets": [ - "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\/.*|$)", - "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", - "^https?:\\/{2}youtu\\.be\\/..*", - "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" - ], - "name": "Youtube", - "defaults": { - "disableYoutube": false, - "enableYoutubeCustomSettings": false, - "onlyEmbeddedVideo": "both", - "youtubeFrontend": "invidious", - "youtubeEmbedFrontend": "invidious" - }, - "imageType": "png" - }, - "youtubeMusic": { - "frontends": { - "beatbump": {}, - "hyperpipe": {} - }, - "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], - "name": "YT Music", - "defaults": { - "disableYoutubeMusic": false, - "youtubeMusicFrontend": "beatbump" - }, - "imageType": "png" - }, - "twitter": { - "frontends": { - "nitter": { - "preferences": { - "cookies": [ - "theme", - "infiniteScroll", - "stickyProfile", - "bidiSupport", - "hideTweetStats", - "hideBanner", - "hidePins", - "hideReplies", - "squareAvatars", - "mp4Playback", - "hlsPlayback", - "proxyVideos", - "muteVideos", - "autoplayGifs", - "replaceInstagram", - "replaceReddit", - "replaceTwitter", - "replaceYouTube" - ] - } - } - }, - "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], - "name": "Twitter", - "defaults": { - "disableTwitter": false, - "twitterRedirectType": "both" - }, - "imageType": "png" - }, - "instagram": { - "frontends": { - "bibliogram": { - "preferences": { - "token": "token", - "fetchEndpoint": "/settings.json", - "setEndpoint": "/applysettings" - } - } - }, - "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], - "name": "Instagram", - "defaults": { - "disableInstagram": false - }, - "imageType": "png" - }, - "tiktok": { - "frontends": { - "proxiTok": {} - }, - "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], - "name": "TikTok", - "defaults": { - "disableTiktok": false - }, - "imageType": "png" - }, - "reddit": { - "frontends": { - "libreddit": { - "preferences": { - "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] - } - }, - "teddit": { - "preferences": { - "cookies": [ - "collapse_child_comments", - "domain_instagram", - "domain_twitter", - "domain_youtube", - "flairs", - "highlight_controversial", - "nsfw_enabled", - "post_media_max_height", - "show_upvoted_percentage", - "show_upvotes", - "theme", - "videos_muted" - ] - } - } - }, - "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], - "name": "Reddit", - "defaults": { - "disableReddit": false, - "redditFrontend": "libreddit" - }, - "imageType": "png" - }, - "imgur": { - "frontends": { - "rimgo": { - "preferences": {} - } - }, - "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], - "name": "Imgur", - "defaults": { "disableImgur": false }, - "imageType": "png" - }, - "wikipedia": { - "frontends": { - "wikiless": { - "preferences": { - "cookies": ["theme", "default_lang"] - } - } - }, - "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], - "name": "Wikipedia", - "defaults": { "disableWikipedia": true }, - "imageType": "svg" - }, - "medium": { - "frontends": { - "scribe": { - "preferences": {} - } - }, - "targets": [ - "(?:.*\\.)*(? { @@ -86,6 +88,7 @@ browser.webRequest.onBeforeRequest.addListener( return null } + /* let newUrl = youtubeMusicHelper.redirect(url, details.type) if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, initiator) if (!newUrl) newUrl = twitterHelper.redirect(url, details.type, initiator) @@ -104,6 +107,8 @@ browser.webRequest.onBeforeRequest.addListener( if (!newUrl) newUrl = translateHelper.redirect(url) if (!newUrl) newUrl = searchHelper.redirect(url) if (!newUrl) newUrl = wikipediaHelper.redirect(url) + */ + let newUrl = servicesHelper.redirect(url, details.type, initiator) if (details.frameAncestors && details.frameAncestors.length > 0 && generalHelper.isException(new URL(details.frameAncestors[0].url))) newUrl = null -- cgit 1.4.1 From 44b9db669710d3a0be06c7aa12c2c787a7ba5cca Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 7 Sep 2022 20:57:15 +0100 Subject: Added basic support for irregular url structures --- src/assets/javascripts/services.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index cf193e30..70d94233 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -50,18 +50,32 @@ init() browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { + let randomInstance if (url.pathname == "/") return - for (curService in config.services) { + for (service in config.services) { if (disabled && !disableOverride) continue if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) continue //if (!targets.some(rx => rx.test(url.href))) continue if (!target.test(url)) continue if (type != redirectType && type != "both") continue - let instanceList = redirects[frontend][curNetwork] - if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet - if (instanceList.length === 0) return - const randomInstance = utils.getRandomInstance(instanceList) - return `${randomInstance}${url.pathname}${url.search}` + for (frontend in service.frontends) { + let instanceList = redirects[frontend][curNetwork] + if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet + if (instanceList.length === 0) return + randomInstance = utils.getRandomInstance(instanceList) + } + } + switch (frontend) { + case "beatbump": + return `${randomInstance}${url.pathname}${url.search}` + .replace("/watch?v=", "/listen?id=") + .replace("/channel/", "/artist/") + .replace("/playlist?list=", "/playlist/VL") + .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=EgWKAQIIAWoKEAMQBBAKEAkQBQ%3D%3D") + case "hyperpipe": + return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) + default: + return `${randomInstance}${url.pathname}${url.search}` } } @@ -102,4 +116,5 @@ function initDefaults() { export default { redirect, + initDefaults, } -- cgit 1.4.1 From f360a6ff1f4e803efe25931bc2d3613915aa608e Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 7 Sep 2022 21:01:29 +0100 Subject: Fix beatbump search redirect from master --- src/assets/javascripts/services.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 70d94233..9b5c08cc 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -71,7 +71,7 @@ function redirect(url, type, initiator) { .replace("/watch?v=", "/listen?id=") .replace("/channel/", "/artist/") .replace("/playlist?list=", "/playlist/VL") - .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=EgWKAQIIAWoKEAMQBBAKEAkQBQ%3D%3D") + .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=song") case "hyperpipe": return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) default: -- cgit 1.4.1 From 4492914535f410515a1221bd07373bd19b208ada Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 8 Sep 2022 21:04:25 +0100 Subject: Add almost all irregular url structures --- src/assets/javascripts/services.js | 272 +++++++++++++++++++++---------------- 1 file changed, 152 insertions(+), 120 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 9b5c08cc..5512916b 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -1,120 +1,152 @@ -window.browser = window.browser || window.chrome - -import utils from "./utils.js" - -let config - -function getConfig() { - return new Promise(async resolve => { - fetch("/config/config.json") - .then(response => response.text()) - .then(data => { - config = JSON.parse(data) - }) - resolve() - }) -} - -let redirects = {} -let disabled, curNetwork, networkFallback, redirectType - -function init() { - return new Promise(async resolve => { - browser.storage.local.get(["network", "networkFallback"], r => { - curNetwork = r.network - networkFallback = r.networkFallback - }) - //cur = current - getConfig() - for (service in config.services) { - redirects = {} - browser.storage.local.get([`disable${camelCase(service)}`, `${service}Redirects`, `${service}RedirectType,`, `${service}Frontend`], r => { - disabled = r["disable" + camelCase(service)] - redirects = r[service + "Redirects"] - frontend = r[service + "Frontend"] - }) - for (frontend in config[service].frontends) { - redirects[frontend] = {} - for (network in config.networks) { - browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { - redirects[frontend][network] = [...r[frontend + camelCase(network) + "RedirectsChecks"], ...r[frontend + camelCase(network) + "CustomRedirects"]] - }) - } - } - } - resolve() - }) -} - -init() -browser.storage.onChanged.addListener(init) - -function redirect(url, type, initiator) { - let randomInstance - if (url.pathname == "/") return - for (service in config.services) { - if (disabled && !disableOverride) continue - if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) continue - //if (!targets.some(rx => rx.test(url.href))) continue - if (!target.test(url)) continue - if (type != redirectType && type != "both") continue - for (frontend in service.frontends) { - let instanceList = redirects[frontend][curNetwork] - if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet - if (instanceList.length === 0) return - randomInstance = utils.getRandomInstance(instanceList) - } - } - switch (frontend) { - case "beatbump": - return `${randomInstance}${url.pathname}${url.search}` - .replace("/watch?v=", "/listen?id=") - .replace("/channel/", "/artist/") - .replace("/playlist?list=", "/playlist/VL") - .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=song") - case "hyperpipe": - return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) - default: - return `${randomInstance}${url.pathname}${url.search}` - } -} - -function initDefaults() { - return new Promise(resolve => { - fetch("/instances/data.json") - .then(response => response.text()) - .then(data => { - let dataJson = JSON.parse(data) - redirects = dataJson - browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { - for (service in config.services) { - for (frontend in service.frontends) { - for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { - let i = redirects[frontend]["clearnet"].indexOf(instance) - if (i > -1) redirects[frontend]["clearnet"].splice(i, 1) - } - browser.storage.local.set({ - ["disable" + camelCase(service)]: false, - [service + "Redirects"]: redirects, - [service + "RedirectType"]: "both", - }) - for (frontend in service.frontends) { - for (protocol in config.protocols) { - browser.storage.local.set({ - [frontend + camelCase(protocol) + "RedirectsChecks"]: [...redirects[frontend][protocol]], - [frontend + camelCase(protocol) + "CustomRedirects"]: [], - }) - } - } - ;() => resolve() - } - } - }) - }) - }) -} - -export default { - redirect, - initDefaults, -} +window.browser = window.browser || window.chrome + +import utils from "./utils.js" + +let config + +function getConfig() { + return new Promise(async resolve => { + fetch("/config/config.json") + .then(response => response.text()) + .then(data => { + config = JSON.parse(data) + }) + resolve() + }) +} + +let redirects = {} +let disabled, curNetwork, networkFallback, redirectType + +function init() { + return new Promise(async resolve => { + browser.storage.local.get(["network", "networkFallback"], r => { + curNetwork = r.network + networkFallback = r.networkFallback + }) + //cur = current + getConfig() + for (service in config.services) { + redirects = {} + browser.storage.local.get([`disable${camelCase(service)}`, `${service}Redirects`, `${service}RedirectType,`, `${service}Frontend`], r => { + disabled = r["disable" + camelCase(service)] + redirects = r[service + "Redirects"] + frontend = r[service + "Frontend"] + }) + for (frontend in config[service].frontends) { + redirects[frontend] = {} + for (network in config.networks) { + browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { + redirects[frontend][network] = [...r[frontend + camelCase(network) + "RedirectsChecks"], ...r[frontend + camelCase(network) + "CustomRedirects"]] + }) + } + } + } + resolve() + }) +} + +init() +browser.storage.onChanged.addListener(init) + +function redirect(url, type, initiator) { + let randomInstance, frontend + if (url.pathname == "/") return + for (service in config.services) { + if (disabled && !disableOverride) continue + if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) continue + //if (!targets.some(rx => rx.test(url.href))) continue + if (!target.test(url)) continue + if (type != redirectType && type != "both") continue + browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) + let instanceList = redirects[frontend][curNetwork] + if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet + if (instanceList.length === 0) return + randomInstance = utils.getRandomInstance(instanceList) + } + switch (frontend) { + // This is where all instance-specific code must be ran to convert the service url to one that can be understood by the frontend. + case "beatbump": + return `${randomInstance}${url.pathname}${url.search}` + .replace("/watch?v=", "/listen?id=") + .replace("/channel/", "/artist/") + .replace("/playlist?list=", "/playlist/VL") + .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=song") + case "hyperpipe": + return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) + case "bibliogram": + const reservedPaths = ["u", "p", "privacy"] + if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1])) return `${randomInstance}${url.pathname}${url.search}` + if (url.pathname.startsWith("/reel") || url.pathname.startsWith("/tv")) return `${randomInstance}/p${url.pathname.replace(/\/reel|\/tv/i, "")}${url.search}` + else return `${randomInstance}/u${url.pathname}${url.search}` // Likely a user profile, redirect to '/u/...' + case "lbryDesktop": + return url.href.replace(/^https?:\/{2}odysee\.com\//, "lbry://").replace(/:(?=[a-zA-Z0-9])/g, "#") + case "neuters": + if (url.pathname.startsWith("/article/") || url.pathname.startsWith("/pf/") || url.pathname.startsWith("/arc/") || url.pathname.startsWith("/resizer/")) return null + else if (url.pathname.endsWith("/")) return `${randomInstance}${url.pathname}` + else return `${randomInstance}${url.pathname}/` + case "searx": + case "searxng": + return `${randomInstance}/?q=${encodeURIComponent(url.searchParams.get("q"))}` + case "whoogle": + return `${randomInstance}/search${encodeURIComponent(url.searchParams.get("q"))}` + case "librex": + return `${randomInstance}/search.php${encodeURIComponent(url.searchParams.get("q"))}` + case "send": + return randomInstance + case "nitter": + if (url.host.split(".")[0] === "pbs" || url.host.split(".")[0] === "video") { + const [, id, format, extra] = url.search.match(/(.*)\?format=(.*)&(.*)/) + const query = encodeURIComponent(`${id}.${format}?${extra}`) + return `${randomInstance}/pic${url.pathname}${query}` + } else if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${url.search}` + else if (url.host == "t.co") return `${randomInstance}/t.co${url.pathname}` + else return `${randomInstance}${url.pathname}${url.search}` + case "yatte": + return url.href.replace(/^https?:\/{2}/, "yattee://") + case "freetube": + return `freetube://https://youtube.com${url.pathname}${url.search}` + case "simplyTranslate": + return `${randomInstance}/${url.search}` + default: + return `${randomInstance}${url.pathname}${url.search}` + } // TODO: Wikiless, All youtube frontends by changing regex, lingva +} + +function initDefaults() { + return new Promise(resolve => { + fetch("/instances/data.json") + .then(response => response.text()) + .then(data => { + let dataJson = JSON.parse(data) + redirects = dataJson + browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { + for (service in config.services) { + for (defaultOption in service.defaults) { + browser.storage.local.set({ + [defaultOption]: defaultOption.value, + }) + } + for (frontend in service.frontends) { + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { + let i = redirects[frontend]["clearnet"].indexOf(instance) + if (i > -1) redirects[frontend]["clearnet"].splice(i, 1) + } + for (network in config.networks) { + browser.storage.local.set({ + [frontend + camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], + [frontend + camelCase(network) + "CustomRedirects"]: [], + }) + } + } + } + ;() => resolve() + }) + }) + }) +} + +export default { + redirect, + initDefaults, +} -- cgit 1.4.1 From 36d01024c887b324f5a4044a88cf79b13c2aba48 Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 8 Sep 2022 21:15:36 +0100 Subject: Make redirect not return on a single instance frontend --- src/assets/javascripts/services.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 5512916b..973e44b4 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -61,7 +61,7 @@ function redirect(url, type, initiator) { browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) let instanceList = redirects[frontend][curNetwork] if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet - if (instanceList.length === 0) return + if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return randomInstance = utils.getRandomInstance(instanceList) } switch (frontend) { -- cgit 1.4.1 From 4cab752e05dd479c4c3da7c06c276de51ca9f637 Mon Sep 17 00:00:00 2001 From: Hygna Date: Fri, 9 Sep 2022 15:55:33 +0100 Subject: All irregular url structures completed --- src/assets/javascripts/services.js | 259 ++++++++++++++++++- src/config/config.json | 2 +- src/pages/background/background.js | 499 +++++++++++++++++++------------------ 3 files changed, 505 insertions(+), 255 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 973e44b4..9c880432 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -6,11 +6,13 @@ let config function getConfig() { return new Promise(async resolve => { + let data fetch("/config/config.json") .then(response => response.text()) .then(data => { - config = JSON.parse(data) + data = JSON.parse(data) }) + config = data resolve() }) } @@ -25,7 +27,6 @@ function init() { networkFallback = r.networkFallback }) //cur = current - getConfig() for (service in config.services) { redirects = {} browser.storage.local.get([`disable${camelCase(service)}`, `${service}Redirects`, `${service}RedirectType,`, `${service}Frontend`], r => { @@ -46,6 +47,8 @@ function init() { }) } +getConfig() +console.log(config) init() browser.storage.onChanged.addListener(init) @@ -54,9 +57,13 @@ function redirect(url, type, initiator) { if (url.pathname == "/") return for (service in config.services) { if (disabled && !disableOverride) continue + let targets = service.targets + if (targets == "datajson") { + browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) + } + if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) continue - //if (!targets.some(rx => rx.test(url.href))) continue - if (!target.test(url)) continue + if (!targets.some(rx => rx.test(url.href))) continue if (type != redirectType && type != "both") continue browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) let instanceList = redirects[frontend][curNetwork] @@ -64,6 +71,26 @@ function redirect(url, type, initiator) { if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return randomInstance = utils.getRandomInstance(instanceList) } + + // Here is a (temperory) space for defining constants required in 2 or more switch cases. + // When possible, try have the two switch cases share all their code as done with searx and searxng. + // Do not do that when they do not share 100% of their code. + + const mapCentreRegex = /@(-?\d[0-9.]*),(-?\d[0-9.]*),(\d{1,2})[.z]/ + const dataLatLngRegex = /!3d(-?[0-9]{1,}.[0-9]{1,})!4d(-?[0-9]{1,}.[0-9]{1,})/ + const placeRegex = /\/place\/(.*)\// + function convertMapCentre() { + let [, lat, lon, zoom] = 0 + if (url.pathname.match(mapCentreRegex)) { + // Set map centre if present + ;[, lat, lon, zoom] = url.pathname.match(mapCentreRegex) + } else if (url.searchParams.has("center")) { + ;[lat, lon] = url.searchParams.get("center").split(",") + zoom = url.searchParams.get("zoom") ?? "17" + } + return [zoom, lon, lat] + } + switch (frontend) { // This is where all instance-specific code must be ran to convert the service url to one that can be understood by the frontend. case "beatbump": @@ -108,9 +135,229 @@ function redirect(url, type, initiator) { return `freetube://https://youtube.com${url.pathname}${url.search}` case "simplyTranslate": return `${randomInstance}/${url.search}` + case "osm": { + if (initiator && initiator.host === "earth.google.com") return + travelModes = { + driving: "fossgis_osrm_car", + walking: "fossgis_osrm_foot", + bicycling: "fossgis_osrm_bike", + transit: "fossgis_osrm_car", // not implemented on OSM, default to car. + } + + function addressToLatLng(address) { + const xmlhttp = new XMLHttpRequest() + xmlhttp.open("GET", `https://nominatim.openstreetmap.org/search/${address}?format=json&limit=1`, false) + xmlhttp.send() + if (xmlhttp.status === 200) { + const json = JSON.parse(xmlhttp.responseText)[0] + if (json) { + console.log("json", json) + return [`${json.lat},${json.lon}`, `${json.boundingbox[2]},${json.boundingbox[1]},${json.boundingbox[3]},${json.boundingbox[0]}`] + } + } + console.info("Error: Status is " + xmlhttp.status) + } + + let mapCentre = "#" + let prefs = {} + + const mapCentreData = convertMapCentre() + if (mapCentreData[0] && mapCentreData[1] && mapCentreData[2]) mapCentre = `#map=${mapCentreData[0]}/${mapCentreData[1]}/${mapCentreData[2]}` + if (url.searchParams.get("layer")) prefs.layers = osmLayers[url.searchParams.get("layer")] + + if (url.pathname.includes("/embed")) { + // Handle Google Maps Embed API + // https://www.google.com/maps/embed/v1/place?key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI&q=Eiffel+Tower,Paris+France + //console.log("embed life") + + let query = "" + if (url.searchParams.has("q")) query = url.searchParams.get("q") + else if (url.searchParams.has("query")) query = url.searchParams.has("query") + else if (url.searchParams.has("pb")) + try { + query = url.searchParams.get("pb").split(/!2s(.*?)!/)[1] + } catch (error) { + console.error(error) + } // Unable to find map marker in URL. + + let [coords, boundingbox] = addressToLatLng(query) + prefs.bbox = boundingbox + prefs.marker = coords + prefs.layer = "mapnik" + let prefsEncoded = new URLSearchParams(prefs).toString() + return `${randomInstance}/export/embed.html?${prefsEncoded}` + } else if (url.pathname.includes("/dir")) { + // Handle Google Maps Directions + // https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicycling + + let travMod = url.searchParams.get("travelmode") + if (url.searchParams.has("travelmode")) prefs.engine = travelModes[travMod] + + let orgVal = url.searchParams.get("origin") + let destVal = url.searchParams.get("destination") + + let org + addressToLatLng(orgVal, a => (org = a)) + let dest + addressToLatLng(destVal, a => (dest = a)) + prefs.route = `${org};${dest}` + + let prefsEncoded = new URLSearchParams(prefs).toString() + return `${randomInstance}/directions?${prefsEncoded}${mapCentre}` + } else if (url.pathname.includes("data=") && url.pathname.match(dataLatLngRegex)) { + // Get marker from data attribute + // https://www.google.com/maps/place/41%C2%B001'58.2%22N+40%C2%B029'18.2%22E/@41.032833,40.4862063,17z/data=!3m1!4b1!4m6!3m5!1s0x0:0xf64286eaf72fc49d!7e2!8m2!3d41.0328329!4d40.4883948 + //console.log("data life") + + let [, mlat, mlon] = url.pathname.match(dataLatLngRegex) + + return `${randomInstance}/search?query=${mlat}%2C${mlon}` + } else if (url.searchParams.has("ll")) { + // Get marker from ll param + // https://maps.google.com/?ll=38.882147,-76.99017 + //console.log("ll life") + + const [mlat, mlon] = url.searchParams.get("ll").split(",") + + return `${randomInstance}/search?query=${mlat}%2C${mlon}` + } else if (url.searchParams.has("viewpoint")) { + // Get marker from viewpoint param. + // https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=48.857832,2.295226&heading=-45&pitch=38&fov=80 + //console.log("viewpoint life") + + const [mlat, mlon] = url.searchParams.get("viewpoint").split(",") + + return `${randomInstance}/search?query=${mlat}%2C${mlon}` + } else { + // Use query as search if present. + //console.log("normal life") + + let query + if (url.searchParams.has("q")) query = url.searchParams.get("q") + else if (url.searchParams.has("query")) query = url.searchParams.get("query") + else if (url.pathname.match(placeRegex)) query = url.pathname.match(placeRegex)[1] + + let prefsEncoded = new URLSearchParams(prefs).toString() + if (query) return `${randomInstance}/search?query="${query}${mapCentre}&${prefsEncoded}` + } + + let prefsEncoded = new URLSearchParams(prefs).toString() + console.log("mapCentre", mapCentre) + console.log("prefs", prefs) + console.log("prefsEncoded", prefsEncoded) + return `${randomInstance}/${mapCentre}&${prefsEncoded}` + } + case "facil": { + if (initiator && initiator.host === "earth.google.com") return + let travelModes = { + driving: "car", + walking: "pedestrian", + bicycling: "bicycle", + transit: "car", // not implemented on Facil, default to car. + } + const mapCentreData = convertMapCentre() + let mapCentre = "#" + if (mapCentreData[0] && mapCentreData[1] && mapCentreData[2]) mapCentre = `#${mapCentreData[0]}/${mapCentreData[1]}/${mapCentreData[2]}` + + if (url.pathname.includes("/embed")) { + // Handle Google Maps Embed API + // https://www.google.com/maps/embed/v1/place?key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI&q=Eiffel+Tower,Paris+France + //console.log("embed life") + + let query = "" + if (url.searchParams.has("q")) query = url.searchParams.get("q") + else if (url.searchParams.has("query")) query = url.searchParams.has("query") + else if (url.searchParams.has("pb")) + try { + query = url.searchParams.get("pb").split(/!2s(.*?)!/)[1] + } catch (error) { + console.error(error) + } // Unable to find map marker in URL. + + return `${randomInstance}/#q=${query}` + } else if (url.pathname.includes("/dir")) { + // Handle Google Maps Directions + // https://www.google.com/maps/dir/?api=1&origin=Space+Needle+Seattle+WA&destination=Pike+Place+Market+Seattle+WA&travelmode=bicycling + + let travMod = url.searchParams.get("travelmode") + + let orgVal = url.searchParams.get("origin") + let destVal = url.searchParams.get("destination") + + return `${randomInstance}/#q=${orgVal}%20to%20${destVal}%20by%20${travelModes[travMod]}` + } else if (url.pathname.includes("data=") && url.pathname.match(dataLatLngRegex)) { + // Get marker from data attribute + // https://www.google.com/maps/place/41%C2%B001'58.2%22N+40%C2%B029'18.2%22E/@41.032833,40.4862063,17z/data=!3m1!4b1!4m6!3m5!1s0x0:0xf64286eaf72fc49d!7e2!8m2!3d41.0328329!4d40.4883948 + //console.log("data life") + + let [, mlat, mlon] = url.pathname.match(dataLatLngRegex) + + return `${randomInstance}/#q=${mlat}%2C${mlon}` + } else if (url.searchParams.has("ll")) { + // Get marker from ll param + // https://maps.google.com/?ll=38.882147,-76.99017 + //console.log("ll life") + + const [mlat, mlon] = url.searchParams.get("ll").split(",") + + return `${randomInstance}/#q=${mlat}%2C${mlon}` + } else if (url.searchParams.has("viewpoint")) { + // Get marker from viewpoint param. + // https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=48.857832,2.295226&heading=-45&pitch=38&fov=80 + //console.log("viewpoint life") + + const [mlat, mlon] = url.searchParams.get("viewpoint").split(",") + + return `${randomInstance}/#q=${mlat}%2C${mlon}` + } else { + // Use query as search if present. + //console.log("normal life") + + let query + if (url.searchParams.has("q")) query = url.searchParams.get("q") + else if (url.searchParams.has("query")) query = url.searchParams.get("query") + else if (url.pathname.match(placeRegex)) query = url.pathname.match(placeRegex)[1] + + if (query) return `${randomInstance}/${mapCentre}/Mpnk/${query}` + } + } + case "wikiless": + let GETArguments = [] + if (url.search.length > 0) { + let search = url.search.substring(1) //get rid of '?' + let argstrings = search.split("&") + for (let i = 0; i < argstrings.length; i++) { + let args = argstrings[i].split("=") + GETArguments.push([args[0], args[1]]) + } + } + + let link = `${randomInstance}${url.pathname}` + let urlSplit = url.host.split(".") + if (urlSplit[0] != "wikipedia" && urlSplit[0] != "www") { + if (urlSplit[0] == "m") GETArguments.push(["mobileaction", "toggle_view_mobile"]) + else GETArguments.push(["lang", urlSplit[0]]) + if (urlSplit[1] == "m") GETArguments.push(["mobileaction", "toggle_view_mobile"]) + // wikiless doesn't have mobile view support yet + } + for (let i = 0; i < GETArguments.length; i++) link += (i == 0 ? "?" : "&") + GETArguments[i][0] + "=" + GETArguments[i][1] + return link + + case "lingva": + let params_arr = url.search.split("&") + params_arr[0] = params_arr[0].substring(1) + let params = {} + for (let i = 0; i < params_arr.length; i++) { + let pair = params_arr[i].split("=") + params[pair[0]] = pair[1] + } + if (params.sl && params.tl && params.text) { + return `${randomInstance}/${params.sl}/${params.tl}/${params.text}` + } + return randomInstance default: return `${randomInstance}${url.pathname}${url.search}` - } // TODO: Wikiless, All youtube frontends by changing regex, lingva + } } function initDefaults() { @@ -124,7 +371,7 @@ function initDefaults() { for (service in config.services) { for (defaultOption in service.defaults) { browser.storage.local.set({ - [defaultOption]: defaultOption.value, + [defaultOption]: service.defaults[defaultOption], }) } for (frontend in service.frontends) { diff --git a/src/config/config.json b/src/config/config.json index db991772..3d4d3f8b 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -64,7 +64,7 @@ }, "singleInstanceFrontends": ["freetube", "yatte"], "targets": [ - "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\/.*|$)", + "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api)/.*|$)", "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 87d498e4..e93e3d03 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -1,248 +1,251 @@ -"use strict" - -import generalHelper from "../../assets/javascripts/general.js" -import utils from "../../assets/javascripts/utils.js" - -import youtubeHelper from "../../assets/javascripts/youtube/youtube.js" -import youtubeMusicHelper from "../../assets/javascripts/youtubeMusic.js" -import twitterHelper from "../../assets/javascripts/twitter.js" -import instagramHelper from "../../assets/javascripts/instagram.js" -import redditHelper from "../../assets/javascripts/reddit.js" -import searchHelper from "../../assets/javascripts/search.js" -import translateHelper from "../../assets/javascripts/translate/translate.js" -import mapsHelper from "../../assets/javascripts/maps.js" -import wikipediaHelper from "../../assets/javascripts/wikipedia.js" -import mediumHelper from "../../assets/javascripts/medium.js" -import quoraHelper from "../../assets/javascripts/quora.js" -import libremdbHelper from "../../assets/javascripts/imdb.js" -import reutersHelper from "../../assets/javascripts/reuters.js" -import imgurHelper from "../../assets/javascripts/imgur.js" -import tiktokHelper from "../../assets/javascripts/tiktok.js" -import sendTargetsHelper from "../../assets/javascripts/sendTargets.js" -import peertubeHelper from "../../assets/javascripts/peertube.js" -import lbryHelper from "../../assets/javascripts/lbry.js" - -import servicesHelper from "../../assets/javascripts/services.js" - -window.browser = window.browser || window.chrome - -browser.runtime.onInstalled.addListener(details => { - function initDefaults() { - fetch("/instances/blacklist.json") - .then(response => response.text()) - .then(async data => { - browser.storage.local.clear(() => { - browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { - browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, () => { - browser.storage.local.set({ offlineBlackList: JSON.parse(data).offline }, () => { - generalHelper.initDefaults() - youtubeHelper.initDefaults() - youtubeMusicHelper.initDefaults() - twitterHelper.initDefaults() - instagramHelper.initDefaults() - mapsHelper.initDefaults() - searchHelper.initDefaults() - translateHelper.initDefaults() - mediumHelper.initDefaults() - quoraHelper.initDefaults() - libremdbHelper.initDefaults() - reutersHelper.initDefaults() - redditHelper.initDefaults() - wikipediaHelper.initDefaults() - imgurHelper.initDefaults() - tiktokHelper.initDefaults() - sendTargetsHelper.initDefaults() - peertubeHelper.initDefaults() - lbryHelper.initDefaults() - }) - }) - }) - }) - }) - } - if (details.reason == "install") initDefaults() - - // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { - // if (details.reason == "update") - // browser.storage.local.get(null, r => { - // if (r.theme) { - // const old = encodeURIComponent(JSON.stringify(r)) - // browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) }); - // } - // initDefaults(); - // }) - // else initDefaults(); - // } -}) - -let BYPASSTABs = [] -browser.webRequest.onBeforeRequest.addListener( - details => { - const url = new URL(details.url) - if (new RegExp(/^chrome-extension:\/{2}.*\/instances\/.*.json$/).test(url.href) && details.type == "xmlhttprequest") return - let initiator - try { - if (details.originUrl) initiator = new URL(details.originUrl) - else if (details.initiator) initiator = new URL(details.initiator) - } catch { - return null - } - - /* - let newUrl = youtubeMusicHelper.redirect(url, details.type) - if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = twitterHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = instagramHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = mapsHelper.redirect(url, initiator) - if (!newUrl) newUrl = redditHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = mediumHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = quoraHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = libremdbHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = reutersHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = imgurHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = tiktokHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = sendTargetsHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = peertubeHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = lbryHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = translateHelper.redirect(url) - if (!newUrl) newUrl = searchHelper.redirect(url) - if (!newUrl) newUrl = wikipediaHelper.redirect(url) - */ - let newUrl = servicesHelper.redirect(url, details.type, initiator) - - 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 - } - console.info("Redirecting", url.href, "=>", newUrl) - return { redirectUrl: newUrl } - } - return null - }, - { urls: [""] }, - ["blocking"] -) - -browser.tabs.onRemoved.addListener(tabId => { - const i = BYPASSTABs.indexOf(tabId) - if (i > -1) { - BYPASSTABs.splice(i, 1) - console.log("Removed BYPASSTABs", 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 youtubeHelper.switchInstance(url, true) - if (!newUrl) newUrl = await twitterHelper.switchInstance(url, true) - if (!newUrl) newUrl = await instagramHelper.switchInstance(url, true) - if (!newUrl) newUrl = await redditHelper.switchInstance(url, true) - if (!newUrl) newUrl = await searchHelper.switchInstance(url, true) - if (!newUrl) newUrl = await translateHelper.switchInstance(url, true) - if (!newUrl) newUrl = await mediumHelper.switchInstance(url, true) - if (!newUrl) newUrl = await quoraHelper.switchInstance(url, true) - if (!newUrl) newUrl = await libremdbHelper.switchInstance(url, true) - if (!newUrl) newUrl = await tiktokHelper.switchInstance(url, true) - if (!newUrl) newUrl = await imgurHelper.switchInstance(url, true) - if (!newUrl) newUrl = await wikipediaHelper.switchInstance(url, true) - if (!newUrl) newUrl = await peertubeHelper.switchInstance(url, true) - if (!newUrl) newUrl = await lbryHelper.switchInstance(url, true) - if (!newUrl) newUrl = await youtubeMusicHelper.switchInstance(url, true) - - if (newUrl) { - if (counter >= 5) { - browser.tabs.update(tabId, { - url: `/pages/errors/instance_offline.html?url=${encodeURIComponent(newUrl)}`, - }) - counter = 0 - } else { - browser.tabs.update(tabId, { url: newUrl }) - counter++ - } - } -} -let counter = 0 - -function isAutoRedirect() { - return new Promise(resolve => browser.storage.local.get("autoRedirect", r => resolve(r.autoRedirect == true))) -} - -browser.webRequest.onResponseStarted.addListener( - async details => { - if (!(await isAutoRedirect())) return null - if (details.type == "main_frame" && details.statusCode >= 500) redirectOfflineInstance(new URL(details.url), details.tabId) - }, - { urls: [""] } -) - -browser.webRequest.onErrorOccurred.addListener( - async details => { - if (!(await isAutoRedirect())) return - if (details.type == "main_frame") redirectOfflineInstance(new URL(details.url), details.tabId) - }, - { urls: [""] } -) - -browser.commands.onCommand.addListener(command => { - if (command === "switchInstance") utils.switchInstance() - else if (command == "copyRaw") utils.copyRaw() - else if (command == "unify") utils.unify() -}) - -browser.contextMenus.create({ - id: "settings", - title: browser.i18n.getMessage("Settings"), - contexts: ["browser_action"], -}) - -browser.contextMenus.create({ - id: "switchInstance", - title: browser.i18n.getMessage("switchInstance"), - contexts: ["browser_action"], -}) - -browser.contextMenus.create({ - id: "copyRaw", - title: browser.i18n.getMessage("copyRaw"), - contexts: ["browser_action"], -}) - -browser.contextMenus.create({ - id: "unify", - title: browser.i18n.getMessage("unifySettings"), - 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.runtime.onMessage.addListener((message, sender, sendResponse) => { - if (message.function === "unify") utils.unify(false).then(r => sendResponse({ response: r })) - return true -}) - -browser.storage.local.set({ version: browser.runtime.getManifest().version }) +"use strict" + +import generalHelper from "../../assets/javascripts/general.js" +import utils from "../../assets/javascripts/utils.js" + +import youtubeHelper from "../../assets/javascripts/youtube/youtube.js" +import youtubeMusicHelper from "../../assets/javascripts/youtubeMusic.js" +import twitterHelper from "../../assets/javascripts/twitter.js" +import instagramHelper from "../../assets/javascripts/instagram.js" +import redditHelper from "../../assets/javascripts/reddit.js" +import searchHelper from "../../assets/javascripts/search.js" +import translateHelper from "../../assets/javascripts/translate/translate.js" +import mapsHelper from "../../assets/javascripts/maps.js" +import wikipediaHelper from "../../assets/javascripts/wikipedia.js" +import mediumHelper from "../../assets/javascripts/medium.js" +import quoraHelper from "../../assets/javascripts/quora.js" +import libremdbHelper from "../../assets/javascripts/imdb.js" +import reutersHelper from "../../assets/javascripts/reuters.js" +import imgurHelper from "../../assets/javascripts/imgur.js" +import tiktokHelper from "../../assets/javascripts/tiktok.js" +import sendTargetsHelper from "../../assets/javascripts/sendTargets.js" +import peertubeHelper from "../../assets/javascripts/peertube.js" +import lbryHelper from "../../assets/javascripts/lbry.js" + +import servicesHelper from "../../assets/javascripts/services.js" + +window.browser = window.browser || window.chrome + +browser.runtime.onInstalled.addListener(details => { + function initDefaults() { + fetch("/instances/blacklist.json") + .then(response => response.text()) + .then(async data => { + browser.storage.local.clear(() => { + browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { + browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, () => { + browser.storage.local.set({ offlineBlackList: JSON.parse(data).offline }, () => { + generalHelper.initDefaults() + /* + youtubeHelper.initDefaults() + youtubeMusicHelper.initDefaults() + twitterHelper.initDefaults() + instagramHelper.initDefaults() + mapsHelper.initDefaults() + searchHelper.initDefaults() + translateHelper.initDefaults() + mediumHelper.initDefaults() + quoraHelper.initDefaults() + libremdbHelper.initDefaults() + reutersHelper.initDefaults() + redditHelper.initDefaults() + wikipediaHelper.initDefaults() + imgurHelper.initDefaults() + tiktokHelper.initDefaults() + sendTargetsHelper.initDefaults() + peertubeHelper.initDefaults() + lbryHelper.initDefaults() + */ + servicesHelper.initDefaults() + }) + }) + }) + }) + }) + } + if (details.reason == "install") initDefaults() + + // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { + // if (details.reason == "update") + // browser.storage.local.get(null, r => { + // if (r.theme) { + // const old = encodeURIComponent(JSON.stringify(r)) + // browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) }); + // } + // initDefaults(); + // }) + // else initDefaults(); + // } +}) + +let BYPASSTABs = [] +browser.webRequest.onBeforeRequest.addListener( + details => { + const url = new URL(details.url) + if (new RegExp(/^chrome-extension:\/{2}.*\/instances\/.*.json$/).test(url.href) && details.type == "xmlhttprequest") return + let initiator + try { + if (details.originUrl) initiator = new URL(details.originUrl) + else if (details.initiator) initiator = new URL(details.initiator) + } catch { + return null + } + + /* + let newUrl = youtubeMusicHelper.redirect(url, details.type) + if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = twitterHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = instagramHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = mapsHelper.redirect(url, initiator) + if (!newUrl) newUrl = redditHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = mediumHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = quoraHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = libremdbHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = reutersHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = imgurHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = tiktokHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = sendTargetsHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = peertubeHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = lbryHelper.redirect(url, details.type, initiator) + if (!newUrl) newUrl = translateHelper.redirect(url) + if (!newUrl) newUrl = searchHelper.redirect(url) + if (!newUrl) newUrl = wikipediaHelper.redirect(url) + */ + let newUrl = servicesHelper.redirect(url, details.type, initiator) + + 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 + } + console.info("Redirecting", url.href, "=>", newUrl) + return { redirectUrl: newUrl } + } + return null + }, + { urls: [""] }, + ["blocking"] +) + +browser.tabs.onRemoved.addListener(tabId => { + const i = BYPASSTABs.indexOf(tabId) + if (i > -1) { + BYPASSTABs.splice(i, 1) + console.log("Removed BYPASSTABs", 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 youtubeHelper.switchInstance(url, true) + if (!newUrl) newUrl = await twitterHelper.switchInstance(url, true) + if (!newUrl) newUrl = await instagramHelper.switchInstance(url, true) + if (!newUrl) newUrl = await redditHelper.switchInstance(url, true) + if (!newUrl) newUrl = await searchHelper.switchInstance(url, true) + if (!newUrl) newUrl = await translateHelper.switchInstance(url, true) + if (!newUrl) newUrl = await mediumHelper.switchInstance(url, true) + if (!newUrl) newUrl = await quoraHelper.switchInstance(url, true) + if (!newUrl) newUrl = await libremdbHelper.switchInstance(url, true) + if (!newUrl) newUrl = await tiktokHelper.switchInstance(url, true) + if (!newUrl) newUrl = await imgurHelper.switchInstance(url, true) + if (!newUrl) newUrl = await wikipediaHelper.switchInstance(url, true) + if (!newUrl) newUrl = await peertubeHelper.switchInstance(url, true) + if (!newUrl) newUrl = await lbryHelper.switchInstance(url, true) + if (!newUrl) newUrl = await youtubeMusicHelper.switchInstance(url, true) + + if (newUrl) { + if (counter >= 5) { + browser.tabs.update(tabId, { + url: `/pages/errors/instance_offline.html?url=${encodeURIComponent(newUrl)}`, + }) + counter = 0 + } else { + browser.tabs.update(tabId, { url: newUrl }) + counter++ + } + } +} +let counter = 0 + +function isAutoRedirect() { + return new Promise(resolve => browser.storage.local.get("autoRedirect", r => resolve(r.autoRedirect == true))) +} + +browser.webRequest.onResponseStarted.addListener( + async details => { + if (!(await isAutoRedirect())) return null + if (details.type == "main_frame" && details.statusCode >= 500) redirectOfflineInstance(new URL(details.url), details.tabId) + }, + { urls: [""] } +) + +browser.webRequest.onErrorOccurred.addListener( + async details => { + if (!(await isAutoRedirect())) return + if (details.type == "main_frame") redirectOfflineInstance(new URL(details.url), details.tabId) + }, + { urls: [""] } +) + +browser.commands.onCommand.addListener(command => { + if (command === "switchInstance") utils.switchInstance() + else if (command == "copyRaw") utils.copyRaw() + else if (command == "unify") utils.unify() +}) + +browser.contextMenus.create({ + id: "settings", + title: browser.i18n.getMessage("Settings"), + contexts: ["browser_action"], +}) + +browser.contextMenus.create({ + id: "switchInstance", + title: browser.i18n.getMessage("switchInstance"), + contexts: ["browser_action"], +}) + +browser.contextMenus.create({ + id: "copyRaw", + title: browser.i18n.getMessage("copyRaw"), + contexts: ["browser_action"], +}) + +browser.contextMenus.create({ + id: "unify", + title: browser.i18n.getMessage("unifySettings"), + 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.runtime.onMessage.addListener((message, sender, sendResponse) => { + if (message.function === "unify") utils.unify(false).then(r => sendResponse({ response: r })) + return true +}) + +browser.storage.local.set({ version: browser.runtime.getManifest().version }) -- cgit 1.4.1 From c005983a0fa6b99186aad02045af29d9466f0ae8 Mon Sep 17 00:00:00 2001 From: Hygna Date: Fri, 9 Sep 2022 22:08:40 +0100 Subject: Make config.json fetching work --- src/assets/javascripts/services.js | 46 ++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 9c880432..1781c4e6 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -2,23 +2,25 @@ window.browser = window.browser || window.chrome import utils from "./utils.js" -let config +let config = {}, + redirects = {}, + options = {} +let disabled, curNetwork, networkFallback, redirectType -function getConfig() { - return new Promise(async resolve => { - let data +async function getConfig() { + return new Promise(resolve => { fetch("/config/config.json") .then(response => response.text()) .then(data => { - data = JSON.parse(data) + config = JSON.parse(data) + resolve() }) - config = data - resolve() }) } -let redirects = {} -let disabled, curNetwork, networkFallback, redirectType +function camelCase(str) { + return str.charAt(0).toUpperCase() + str.slice(1) +} function init() { return new Promise(async resolve => { @@ -27,16 +29,16 @@ function init() { networkFallback = r.networkFallback }) //cur = current - for (service in config.services) { - redirects = {} + for (const service in config.services) { + options[service] = {} browser.storage.local.get([`disable${camelCase(service)}`, `${service}Redirects`, `${service}RedirectType,`, `${service}Frontend`], r => { - disabled = r["disable" + camelCase(service)] - redirects = r[service + "Redirects"] - frontend = r[service + "Frontend"] + options[service].disabled = r["disable" + camelCase(service)] + options[service].redirects = r[service + "Redirects"] + options[service].frontend = r[service + "Frontend"] }) - for (frontend in config[service].frontends) { + for (const frontend in config.services[service].frontends) { redirects[frontend] = {} - for (network in config.networks) { + for (const network in config.networks) { browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { redirects[frontend][network] = [...r[frontend + camelCase(network) + "RedirectsChecks"], ...r[frontend + camelCase(network) + "CustomRedirects"]] }) @@ -47,7 +49,7 @@ function init() { }) } -getConfig() +await getConfig() console.log(config) init() browser.storage.onChanged.addListener(init) @@ -55,7 +57,7 @@ browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { let randomInstance, frontend if (url.pathname == "/") return - for (service in config.services) { + for (const service in config.services) { if (disabled && !disableOverride) continue let targets = service.targets if (targets == "datajson") { @@ -368,18 +370,18 @@ function initDefaults() { let dataJson = JSON.parse(data) redirects = dataJson browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { - for (service in config.services) { - for (defaultOption in service.defaults) { + for (const service in config.services) { + for (const defaultOption in service.defaults) { browser.storage.local.set({ [defaultOption]: service.defaults[defaultOption], }) } - for (frontend in service.frontends) { + for (const frontend in service.frontends) { for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { let i = redirects[frontend]["clearnet"].indexOf(instance) if (i > -1) redirects[frontend]["clearnet"].splice(i, 1) } - for (network in config.networks) { + for (const network in config.networks) { browser.storage.local.set({ [frontend + camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], [frontend + camelCase(network) + "CustomRedirects"]: [], -- cgit 1.4.1 From 25de09a9359eda0c038640b2a792cd3c753f5511 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sat, 10 Sep 2022 20:48:57 +0100 Subject: Further progress --- src/assets/javascripts/general.js | 4 +- src/assets/javascripts/services.js | 31 ++++++++---- src/instances/beatbump.json | 4 +- src/instances/bibliogram.json | 6 +++ src/instances/cloudtube.json | 2 +- src/instances/facil.json | 2 +- src/instances/get_instances.py | 101 +++++++++++++++++-------------------- src/instances/neuters.json | 2 +- 8 files changed, 82 insertions(+), 70 deletions(-) create mode 100644 src/instances/bibliogram.json diff --git a/src/assets/javascripts/general.js b/src/assets/javascripts/general.js index a8360bd5..072ff3c1 100644 --- a/src/assets/javascripts/general.js +++ b/src/assets/javascripts/general.js @@ -30,8 +30,8 @@ async function initDefaults() { popupFrontends: ["youtube", "twitter", "instagram", "tiktok", "imgur", "reddit", "quora", "translate", "maps"], autoRedirect: false, firstPartyIsolate: false, - protocol: "normal", - protocolFallback: true, + network: "clearnet", + networkFallback: true, latencyThreshold: 1000, }, () => resolve() diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 1781c4e6..7dc93470 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -35,11 +35,14 @@ function init() { options[service].disabled = r["disable" + camelCase(service)] options[service].redirects = r[service + "Redirects"] options[service].frontend = r[service + "Frontend"] + // console.log(r) }) for (const frontend in config.services[service].frontends) { redirects[frontend] = {} for (const network in config.networks) { browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { + console.log(r) + // console.log(`${frontend}${camelCase(network)}RedirectsChecks`) redirects[frontend][network] = [...r[frontend + camelCase(network) + "RedirectsChecks"], ...r[frontend + camelCase(network) + "CustomRedirects"]] }) } @@ -49,9 +52,15 @@ function init() { }) } +function all(service) { + let tmp = [] + for (frontend in config.services[service].frontends) { + for (network in config.networks) tmp.push([...redirects[frontend][network]]) + } +} + await getConfig() -console.log(config) -init() +await init() browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { @@ -64,7 +73,7 @@ function redirect(url, type, initiator) { browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) } - if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) continue + if (initiator && (all(service).includes(initiator.origin) || targets.includes(initiator.host))) continue if (!targets.some(rx => rx.test(url.href))) continue if (type != redirectType && type != "both") continue browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) @@ -363,20 +372,24 @@ function redirect(url, type, initiator) { } function initDefaults() { - return new Promise(resolve => { + return new Promise(async resolve => { fetch("/instances/data.json") .then(response => response.text()) - .then(data => { + .then(async data => { let dataJson = JSON.parse(data) redirects = dataJson + console.log(redirects) + console.log(config) browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { for (const service in config.services) { for (const defaultOption in service.defaults) { - browser.storage.local.set({ - [defaultOption]: service.defaults[defaultOption], - }) + browser.storage.local.set({ [defaultOption]: service.defaults[defaultOption] }) } - for (const frontend in service.frontends) { + for (const frontend in config.services[service].frontends) { + if ((config.services[service].targets = "datajson")) { + browser.storage.local.set({ [service + "Targets"]: redirects[service] }) + continue + } for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { let i = redirects[frontend]["clearnet"].indexOf(instance) if (i > -1) redirects[frontend]["clearnet"].splice(i, 1) diff --git a/src/instances/beatbump.json b/src/instances/beatbump.json index 4c7f65a6..c5c78123 100644 --- a/src/instances/beatbump.json +++ b/src/instances/beatbump.json @@ -1,6 +1,6 @@ { - "normal": ["https://beatbump.ml"], - "tor": [], + "clearnet": ["https://beatbump.ml", "https://beatbump.esmailelbob.xyz"], + "tor": ["http://beatbump.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion"], "i2p": [], "loki": [] } diff --git a/src/instances/bibliogram.json b/src/instances/bibliogram.json new file mode 100644 index 00000000..b08aa7a0 --- /dev/null +++ b/src/instances/bibliogram.json @@ -0,0 +1,6 @@ +{ + "clearnet": ["https://bibliogram.1d4.us", "https://bibliogram.froth.zone", "https://ig.tokhmi.xyz", "https://ig.beparanoid.de", "https://bibliogram.priv.pw"], + "tor": [], + "i2p": [], + "loki": [] +} diff --git a/src/instances/cloudtube.json b/src/instances/cloudtube.json index 402adc39..caba9d9c 100644 --- a/src/instances/cloudtube.json +++ b/src/instances/cloudtube.json @@ -1,5 +1,5 @@ { - "normal": ["https://tube.cadence.moe", "https://yt.beparanoid.de"], + "clearnet": ["https://tube.cadence.moe", "https://yt.beparanoid.de"], "tor": ["http://yt.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion"], "i2p": [], "loki": [] diff --git a/src/instances/facil.json b/src/instances/facil.json index 798a9cfb..6c89eb17 100644 --- a/src/instances/facil.json +++ b/src/instances/facil.json @@ -1,5 +1,5 @@ { - "normal": ["https://facilmap.org"], + "clearnet": ["https://facilmap.org"], "tor": [], "i2p": [], "loki": [] diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index eab4a924..a95eb46f 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -107,13 +107,13 @@ def invidious(): r = requests.get('https://api.invidious.io/instances.json') rJson = json.loads(r.text) invidiousList = {} - invidiousList['normal'] = [] + invidiousList['clearnet'] = [] invidiousList['tor'] = [] invidiousList['i2p'] = [] invidiousList['loki'] = [] for instance in rJson: if instance[1]['type'] == 'https': - invidiousList['normal'].append(instance[1]['uri']) + invidiousList['clearnet'].append(instance[1]['uri']) elif instance[1]['type'] == 'onion': invidiousList['tor'].append(instance[1]['uri']) mightyList['invidious'] = invidiousList @@ -127,7 +127,7 @@ def piped(): tmp = re.findall( '(?:[^\s\/]+\.)+[a-zA-Z]+ (?:\(Official\) )?\| (https:\/{2}(?:[^\s\/]+\.)+[a-zA-Z]+) \| ', r.text) _list = {} - _list['normal'] = [] + _list['clearnet'] = [] _list['tor'] = [] _list['i2p'] = [] _list['loki'] = [] @@ -137,7 +137,7 @@ def piped(): if url.strip("/") == item: continue else: - _list['normal'].append(url) + _list['clearnet'].append(url) except: continue mightyList['piped'] = _list @@ -151,12 +151,12 @@ def pipedMaterial(): tmp = re.findall( r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\|", r.text) pipedMaterialList = {} - pipedMaterialList['normal'] = [] + pipedMaterialList['clearnet'] = [] pipedMaterialList['tor'] = [] pipedMaterialList['i2p'] = [] pipedMaterialList['loki'] = [] for item in tmp: - pipedMaterialList['normal'].append(item) + pipedMaterialList['clearnet'].append(item) mightyList['pipedMaterial'] = pipedMaterialList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'pipedMaterial') @@ -175,12 +175,12 @@ def proxitok(): tmp = re.findall( r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text) proxiTokList = {} - proxiTokList['normal'] = [] + proxiTokList['clearnet'] = [] proxiTokList['tor'] = [] proxiTokList['i2p'] = [] proxiTokList['loki'] = [] for item in tmp: - proxiTokList['normal'].append(re.sub(r'/$', '', item)) + proxiTokList['clearnet'].append(re.sub(r'/$', '', item)) mightyList['proxiTok'] = proxiTokList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'ProxiTok') @@ -191,12 +191,12 @@ def send(): tmp = re.findall( r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}", r.text) sendList = {} - sendList['normal'] = [] + sendList['clearnet'] = [] sendList['tor'] = [] sendList['i2p'] = [] sendList['loki'] = [] for item in tmp: - sendList['normal'].append(item) + sendList['clearnet'].append(item) mightyList['send'] = sendList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Send') @@ -207,7 +207,7 @@ def nitter(): r"(?:(?:\| \[(?:\S+\.)+[a-zA-Z]+\]\((https?:\/{2}(?:\S+\.)+[a-zA-Z]+)\/?\) (?:\((?:\S+ ?\S*)\) )? *\| [^❌]{1,3} +\|(?:(?:\n)|(?: (?:❌)|(?: ✅)|(?: ❓)|(?: \[))))|(?:- \[(?:\S+\.)+(?:(?:i2p)|(?:loki))\]\((https?:\/{2}(?:\S+\.)(?:(?:i2p)|(?:loki)))\/?\)))", r.text) nitterList = {} - nitterList['normal'] = [] + nitterList['clearnet'] = [] nitterList['tor'] = [] nitterList['i2p'] = [] nitterList['loki'] = [] @@ -224,22 +224,15 @@ def nitter(): elif re.search(lokiRegex, item): nitterList['loki'].append(item) else: - nitterList['normal'].append(item) + nitterList['clearnet'].append(item) mightyList['nitter'] = nitterList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Nitter') def bibliogram(): - r = requests.get('https://bibliogram.art/api/instances') - rJson = json.loads(r.text) - bibliogramList = {} - bibliogramList['normal'] = [] - bibliogramList['tor'] = [] - bibliogramList['i2p'] = [] - bibliogramList['loki'] = [] - for item in rJson['data']: - bibliogramList['normal'].append(item['address']) - mightyList['bibliogram'] = bibliogramList + json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) + with open('./src/instances/bibliogram.json') as file: + mightyList['bibliogram'] = json.load(file) print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Bibliogram') @@ -247,7 +240,7 @@ def libreddit(): r = requests.get( 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md') libredditList = {} - libredditList['normal'] = [] + libredditList['clearnet'] = [] libredditList['tor'] = [] libredditList['i2p'] = [] libredditList['loki'] = [] @@ -259,7 +252,7 @@ def libreddit(): if re.search(torRegex, item): libredditList['tor'].append(item) else: - libredditList['normal'].append(item) + libredditList['clearnet'].append(item) mightyList['libreddit'] = libredditList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LibReddit') @@ -269,14 +262,14 @@ def teddit(): 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json') rJson = json.loads(r.text) tedditList = {} - tedditList['normal'] = [] + tedditList['clearnet'] = [] tedditList['tor'] = [] tedditList['i2p'] = [] tedditList['loki'] = [] for item in rJson: url = item['url'] if url != '': - tedditList['normal'].append(url) + tedditList['clearnet'].append(url) if 'onion' in item: onion = item['onion'] if onion != '': @@ -290,14 +283,14 @@ def wikiless(): r = requests.get('https://wikiless.org/instances.json') rJson = json.loads(r.text) wikilessList = {} - wikilessList['normal'] = [] + wikilessList['clearnet'] = [] wikilessList['tor'] = [] wikilessList['i2p'] = [] wikilessList['loki'] = [] for item in rJson: if 'url' in item: if item['url'].strip() != "": - wikilessList['normal'].append(item['url']) + wikilessList['clearnet'].append(item['url']) if 'onion' in item: if item['onion'].strip() != "": wikilessList['tor'].append(item['onion']) @@ -313,12 +306,12 @@ def scribe(): 'https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json') rJson = json.loads(r.text) scribeList = {} - scribeList['normal'] = [] + scribeList['clearnet'] = [] scribeList['tor'] = [] scribeList['i2p'] = [] scribeList['loki'] = [] for item in rJson: - scribeList['normal'].append(item) + scribeList['clearnet'].append(item) mightyList['scribe'] = scribeList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Scribe') @@ -327,7 +320,7 @@ def quetre(): r = requests.get( 'https://raw.githubusercontent.com/zyachel/quetre/main/README.md') _list = {} - _list['normal'] = [] + _list['clearnet'] = [] _list['tor'] = [] _list['i2p'] = [] _list['loki'] = [] @@ -340,7 +333,7 @@ def quetre(): if re.search(torRegex, item): _list['tor'].append(item) else: - _list['normal'].append(item) + _list['clearnet'].append(item) mightyList['quetre'] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Quetre') @@ -349,7 +342,7 @@ def libremdb(): r = requests.get( 'https://raw.githubusercontent.com/zyachel/libremdb/main/README.md') _list = {} - _list['normal'] = [] + _list['clearnet'] = [] _list['tor'] = [] _list['i2p'] = [] _list['loki'] = [] @@ -364,7 +357,7 @@ def libremdb(): if re.search(torRegex, item): _list['tor'].append(item) else: - _list['normal'].append(item) + _list['clearnet'].append(item) mightyList['libremdb'] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Libremdb') @@ -372,12 +365,12 @@ def libremdb(): def simpleertube(): r = requests.get('https://simple-web.org/instances/simpleertube') _list = {} - _list['normal'] = [] + _list['clearnet'] = [] _list['tor'] = [] _list['i2p'] = [] _list['loki'] = [] for item in r.text.strip().split('\n'): - _list['normal'].append('https://' + item) + _list['clearnet'].append('https://' + item) mightyList['simpleertube'] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SimpleerTube') @@ -386,9 +379,9 @@ def simpleertube(): def simplytranslate(): r = requests.get('https://simple-web.org/instances/simplytranslate') simplyTranslateList = {} - simplyTranslateList['normal'] = [] + simplyTranslateList['clearnet'] = [] for item in r.text.strip().split('\n'): - simplyTranslateList['normal'].append('https://' + item) + simplyTranslateList['clearnet'].append('https://' + item) r = requests.get('https://simple-web.org/instances/simplytranslate_onion') simplyTranslateList['tor'] = [] @@ -414,12 +407,12 @@ def linvgatranslate(): 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json') rJson = json.loads(r.text) lingvaList = {} - lingvaList['normal'] = [] + lingvaList['clearnet'] = [] lingvaList['tor'] = [] lingvaList['i2p'] = [] lingvaList['loki'] = [] for item in rJson: - lingvaList['normal'].append(item) + lingvaList['clearnet'].append(item) mightyList['lingva'] = lingvaList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LinvgaTranslate') @@ -429,12 +422,12 @@ def searx_searxng(): r = requests.get('https://searx.space/data/instances.json') rJson = json.loads(r.text) searxList = {} - searxList['normal'] = [] + searxList['clearnet'] = [] searxList['tor'] = [] searxList['i2p'] = [] searxList['loki'] = [] searxngList = {} - searxngList['normal'] = [] + searxngList['clearnet'] = [] searxngList['tor'] = [] searxngList['i2p'] = [] searxngList['loki'] = [] @@ -451,9 +444,9 @@ def searx_searxng(): searxList['i2p'].append(item[:-1]) else: if (rJson['instances'][item].get('generator') == 'searxng'): - searxngList['normal'].append(item[:-1]) + searxngList['clearnet'].append(item[:-1]) else: - searxList['normal'].append(item[:-1]) + searxList['clearnet'].append(item[:-1]) mightyList['searx'] = searxList mightyList['searxng'] = searxngList @@ -465,7 +458,7 @@ def whoogle(): 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt') tmpList = r.text.strip().split('\n') whoogleList = {} - whoogleList['normal'] = [] + whoogleList['clearnet'] = [] whoogleList['tor'] = [] whoogleList['i2p'] = [] whoogleList['loki'] = [] @@ -475,7 +468,7 @@ def whoogle(): elif re.search(torRegex, item): whoogleList['i2p'].append(item) else: - whoogleList['normal'].append(item) + whoogleList['clearnet'].append(item) mightyList['whoogle'] = whoogleList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Whoogle') @@ -484,7 +477,7 @@ def librex(): r = requests.get( 'https://raw.githubusercontent.com/hnhx/librex/main/README.md') _list = {} - _list['normal'] = [] + _list['clearnet'] = [] _list['tor'] = [] _list['i2p'] = [] _list['loki'] = [] @@ -500,7 +493,7 @@ def librex(): elif re.search(i2pRegex, item): _list['i2p'].append(item) else: - _list['normal'].append(item) + _list['clearnet'].append(item) mightyList['librex'] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librex') @@ -510,13 +503,13 @@ def rimgo(): 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json') rJson = json.loads(r.text) rimgoList = {} - rimgoList['normal'] = [] + rimgoList['clearnet'] = [] rimgoList['tor'] = [] rimgoList['i2p'] = [] rimgoList['loki'] = [] for item in rJson: if 'url' in item: - rimgoList['normal'].append(item['url']) + rimgoList['clearnet'].append(item['url']) if 'onion' in item: rimgoList['tor'].append(item['onion']) if 'i2p' in item: @@ -530,7 +523,7 @@ def librarian(): 'https://codeberg.org/librarian/librarian/raw/branch/main/instances.json') rJson = json.loads(r.text) librarianList = {} - librarianList['normal'] = [] + librarianList['clearnet'] = [] librarianList['tor'] = [] librarianList['i2p'] = [] librarianList['loki'] = [] @@ -546,7 +539,7 @@ def librarian(): elif re.search(lokiRegex, url): librarianList['loki'].append(url) else: - librarianList['normal'].append(url) + librarianList['clearnet'].append(url) mightyList['librarian'] = librarianList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librarian') @@ -570,7 +563,7 @@ def hyperpipe(): 'https://codeberg.org/Hyperpipe/pages/raw/branch/main/api/frontend.json') rJson = json.loads(r.text) hyperpipeList = {} - hyperpipeList['normal'] = [] + hyperpipeList['clearnet'] = [] hyperpipeList['tor'] = [] hyperpipeList['i2p'] = [] hyperpipeList['loki'] = [] @@ -585,7 +578,7 @@ def hyperpipe(): elif re.search(lokiRegex, url): hyperpipeList['loki'].append(url) else: - hyperpipeList['normal'].append(url) + hyperpipeList['clearnet'].append(url) mightyList['hyperpipe'] = hyperpipeList print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Hyperpipe') diff --git a/src/instances/neuters.json b/src/instances/neuters.json index 9e224a52..8023079b 100644 --- a/src/instances/neuters.json +++ b/src/instances/neuters.json @@ -1,5 +1,5 @@ { - "normal": ["https://neuters.de"], + "clearnet": ["https://neuters.de"], "tor": [], "i2p": [], "loki": [] -- cgit 1.4.1 From e04c79d4ae7b66e6bac2b16f80f89f98040212c3 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sun, 11 Sep 2022 14:41:06 +0100 Subject: Embrace object usage for user-set options --- src/assets/javascripts/services.js | 81 ++++++++++++++++++++++++-------------- src/config/config.json | 6 +-- 2 files changed, 54 insertions(+), 33 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 7dc93470..4dba8a7b 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -5,7 +5,6 @@ import utils from "./utils.js" let config = {}, redirects = {}, options = {} -let disabled, curNetwork, networkFallback, redirectType async function getConfig() { return new Promise(resolve => { @@ -25,25 +24,29 @@ function camelCase(str) { function init() { return new Promise(async resolve => { browser.storage.local.get(["network", "networkFallback"], r => { - curNetwork = r.network - networkFallback = r.networkFallback + options.network = r.network + options.networkFallback = r.networkFallback + options.redirects = r.redirects }) //cur = current for (const service in config.services) { options[service] = {} - browser.storage.local.get([`disable${camelCase(service)}`, `${service}Redirects`, `${service}RedirectType,`, `${service}Frontend`], r => { + browser.storage.local.get([`disable${camelCase(service)}`, `${service}RedirectType`, `${service}Frontend`], r => { options[service].disabled = r["disable" + camelCase(service)] - options[service].redirects = r[service + "Redirects"] options[service].frontend = r[service + "Frontend"] + options[service].redirectType = r[service + "RedirectType"] // console.log(r) }) for (const frontend in config.services[service].frontends) { - redirects[frontend] = {} + options[frontend] = {} + options[frontend].checks = [] + options[frontend].custom = [] for (const network in config.networks) { browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { - console.log(r) + // console.log(r) // console.log(`${frontend}${camelCase(network)}RedirectsChecks`) - redirects[frontend][network] = [...r[frontend + camelCase(network) + "RedirectsChecks"], ...r[frontend + camelCase(network) + "CustomRedirects"]] + options[frontend].checks = r[frontend + camelCase(network) + "RedirectsChecks"] + options[frontend].custom = r[frontend + camelCase(network) + "CustomRedirects"] }) } } @@ -57,17 +60,21 @@ function all(service) { for (frontend in config.services[service].frontends) { for (network in config.networks) tmp.push([...redirects[frontend][network]]) } + return tmp } -await getConfig() -await init() +getConfig() +init() browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { - let randomInstance, frontend + let randomInstance + let frontend = options[service].frontend + let network = options.network + let networkFallback = options.networkFallback if (url.pathname == "/") return for (const service in config.services) { - if (disabled && !disableOverride) continue + if (options[service].disabled && !disableOverride) continue let targets = service.targets if (targets == "datajson") { browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) @@ -75,10 +82,10 @@ function redirect(url, type, initiator) { if (initiator && (all(service).includes(initiator.origin) || targets.includes(initiator.host))) continue if (!targets.some(rx => rx.test(url.href))) continue - if (type != redirectType && type != "both") continue - browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) - let instanceList = redirects[frontend][curNetwork] - if (instanceList.length === 0 && networkFallback) instanceList = redirects[frontend].clearnet + if (type != options[service].redirectType && type != "both") continue + // browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) + let instanceList = [...[service + camelCase(network) + "RedirectsChecks"], ...[service + camelCase(network) + "CustomRedirects"]] + if (instanceList.length === 0 && networkFallback) instanceList = [...[service + "ClearnetRedirectsChecks"], ...[service + "ClearnetCustomRedirects"]] if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return randomInstance = utils.getRandomInstance(instanceList) } @@ -378,27 +385,41 @@ function initDefaults() { .then(async data => { let dataJson = JSON.parse(data) redirects = dataJson - console.log(redirects) - console.log(config) + // console.log(redirects) + // console.log(config) + browser.storage.local.set({ + redirects, + }) browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { + // console.log(r) for (const service in config.services) { - for (const defaultOption in service.defaults) { - browser.storage.local.set({ [defaultOption]: service.defaults[defaultOption] }) + if (config.services[service].targets == "datajson") { + browser.storage.local.set({ [service + "Targets"]: redirects[service] }) + } + for (const defaultOption in config.services[service].defaults) { + browser.storage.local.set({ [defaultOption]: config.services[service].defaults[defaultOption] }) } for (const frontend in config.services[service].frontends) { - if ((config.services[service].targets = "datajson")) { - browser.storage.local.set({ [service + "Targets"]: redirects[service] }) - continue - } + let clearnetChecks = redirects[frontend][clearnet] for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { - let i = redirects[frontend]["clearnet"].indexOf(instance) - if (i > -1) redirects[frontend]["clearnet"].splice(i, 1) + let i = clearnetChecks.indexOf(instance) + if (i > -1) clearnetChecks.splice(i, 1) } for (const network in config.networks) { - browser.storage.local.set({ - [frontend + camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], - [frontend + camelCase(network) + "CustomRedirects"]: [], - }) + console.log(redirects[frontend][network]) + switch (network) { + case "clearnet": + browser.storage.local.set({ + [frontend + "ClearnetRedirectsChecks"]: [clearnetChecks], + [frontend + "ClearnetCustomRedirects"]: [], + }) + break + default: + browser.storage.local.set({ + [frontend + camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], + [frontend + camelCase(network) + "CustomRedirects"]: [], + }) + } } } } diff --git a/src/config/config.json b/src/config/config.json index 3d4d3f8b..6c4d8026 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -293,7 +293,7 @@ "targets": "datajson", "name": "PeerTube", "defaults": { - "disablePeertubeTargets": true + "disablePeertube": true }, "imageType": "svg" }, @@ -310,7 +310,7 @@ "targets": ["^https?:\\/{2}odysee\\.com", "^https?:\\/{2}lbry\\.tv"], "name": "LBRY", "defaults": { - "disableLbryTargets": true, + "disableLbry": true, "lbryFrontend": "librarian", "lbryRedirectType": "both" }, @@ -429,7 +429,7 @@ "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid\\/$", "^https?:\\/{2}send\\.firefox\\.com\\/$", "^https?:\\/{2}sendfiles\\.online\\/$"], "name": "Send Files", "defaults": { - "disableSendTarget": false + "disableSendTargets": false }, "imageType": "svg" } -- cgit 1.4.1 From d6cad17a15e76635d3e51e03b52414e66ef83ac3 Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 12 Sep 2022 18:17:25 +0100 Subject: Begin work with ejs, created widgets/services.js --- src/assets/javascripts/services.js | 29 +++--- src/assets/javascripts/utils.js | 16 +-- src/config/config.json | 154 +++++++++++++++-------------- src/pages/options/index.html | 58 +++++------ src/pages/options/widgets/about.ejs | 24 +++++ src/pages/options/widgets/general.js | 60 +++-------- src/pages/options/widgets/general.pug | 2 +- src/pages/options/widgets/imdb.js | 4 +- src/pages/options/widgets/imdb.pug | 2 +- src/pages/options/widgets/imgur.js | 4 +- src/pages/options/widgets/imgur.pug | 2 +- src/pages/options/widgets/instagram.js | 4 +- src/pages/options/widgets/instagram.pug | 2 +- src/pages/options/widgets/lbry.js | 4 +- src/pages/options/widgets/lbry.pug | 2 +- src/pages/options/widgets/maps.js | 4 +- src/pages/options/widgets/maps.pug | 2 +- src/pages/options/widgets/medium.js | 4 +- src/pages/options/widgets/medium.pug | 2 +- src/pages/options/widgets/peertube.js | 4 +- src/pages/options/widgets/peertube.pug | 2 +- src/pages/options/widgets/quora.js | 4 +- src/pages/options/widgets/quora.pug | 2 +- src/pages/options/widgets/reddit.js | 4 +- src/pages/options/widgets/reddit.pug | 4 +- src/pages/options/widgets/reuters.js | 4 +- src/pages/options/widgets/reuters.pug | 2 +- src/pages/options/widgets/search.js | 117 +--------------------- src/pages/options/widgets/search.pug | 8 +- src/pages/options/widgets/sendTargets.js | 4 +- src/pages/options/widgets/sendTargets.pug | 2 +- src/pages/options/widgets/services.ejs | 84 ++++++++++++++++ src/pages/options/widgets/services.js | 81 +++++++++++++++ src/pages/options/widgets/tiktok.js | 4 +- src/pages/options/widgets/tiktok.pug | 2 +- src/pages/options/widgets/translate.js | 4 +- src/pages/options/widgets/translate.pug | 4 +- src/pages/options/widgets/twitter.js | 4 +- src/pages/options/widgets/twitter.pug | 2 +- src/pages/options/widgets/wikipedia.js | 4 +- src/pages/options/widgets/wikipedia.pug | 2 +- src/pages/options/widgets/youtube.js | 4 +- src/pages/options/widgets/youtube.pug | 8 +- src/pages/options/widgets/youtubeMusic.js | 4 +- src/pages/options/widgets/youtubeMusic.pug | 4 +- 45 files changed, 393 insertions(+), 354 deletions(-) create mode 100644 src/pages/options/widgets/about.ejs create mode 100644 src/pages/options/widgets/services.ejs create mode 100644 src/pages/options/widgets/services.js diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 4dba8a7b..b7ee2205 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -17,10 +17,6 @@ async function getConfig() { }) } -function camelCase(str) { - return str.charAt(0).toUpperCase() + str.slice(1) -} - function init() { return new Promise(async resolve => { browser.storage.local.get(["network", "networkFallback"], r => { @@ -31,8 +27,8 @@ function init() { //cur = current for (const service in config.services) { options[service] = {} - browser.storage.local.get([`disable${camelCase(service)}`, `${service}RedirectType`, `${service}Frontend`], r => { - options[service].disabled = r["disable" + camelCase(service)] + browser.storage.local.get([`disable${utils.camelCase(service)}`, `${service}RedirectType`, `${service}Frontend`], r => { + options[service].disabled = r["disable" + utils.camelCase(service)] options[service].frontend = r[service + "Frontend"] options[service].redirectType = r[service + "RedirectType"] // console.log(r) @@ -42,11 +38,11 @@ function init() { options[frontend].checks = [] options[frontend].custom = [] for (const network in config.networks) { - browser.storage.local.get([`${frontend}${camelCase(network)}RedirectsChecks`, `${frontend}${camelCase(network)}CustomRedirects`], r => { + browser.storage.local.get([`${frontend}${utils.camelCase(network)}RedirectsChecks`, `${frontend}${utils.camelCase(network)}CustomRedirects`], r => { // console.log(r) - // console.log(`${frontend}${camelCase(network)}RedirectsChecks`) - options[frontend].checks = r[frontend + camelCase(network) + "RedirectsChecks"] - options[frontend].custom = r[frontend + camelCase(network) + "CustomRedirects"] + // console.log(`${frontend}${utils.camelCase(network)}RedirectsChecks`) + options[frontend].checks = r[frontend + utils.camelCase(network) + "RedirectsChecks"] + options[frontend].custom = r[frontend + utils.camelCase(network) + "CustomRedirects"] }) } } @@ -72,6 +68,7 @@ function redirect(url, type, initiator) { let frontend = options[service].frontend let network = options.network let networkFallback = options.networkFallback + let redirectType = options[service].redirectType if (url.pathname == "/") return for (const service in config.services) { if (options[service].disabled && !disableOverride) continue @@ -82,9 +79,9 @@ function redirect(url, type, initiator) { if (initiator && (all(service).includes(initiator.origin) || targets.includes(initiator.host))) continue if (!targets.some(rx => rx.test(url.href))) continue - if (type != options[service].redirectType && type != "both") continue + if (type != redirectType && type != "both") continue // browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) - let instanceList = [...[service + camelCase(network) + "RedirectsChecks"], ...[service + camelCase(network) + "CustomRedirects"]] + let instanceList = [...[service + utils.camelCase(network) + "RedirectsChecks"], ...[service + utils.camelCase(network) + "CustomRedirects"]] if (instanceList.length === 0 && networkFallback) instanceList = [...[service + "ClearnetRedirectsChecks"], ...[service + "ClearnetCustomRedirects"]] if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return randomInstance = utils.getRandomInstance(instanceList) @@ -400,13 +397,13 @@ function initDefaults() { browser.storage.local.set({ [defaultOption]: config.services[service].defaults[defaultOption] }) } for (const frontend in config.services[service].frontends) { - let clearnetChecks = redirects[frontend][clearnet] + let clearnetChecks = redirects[frontend].clearnet for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { let i = clearnetChecks.indexOf(instance) if (i > -1) clearnetChecks.splice(i, 1) } for (const network in config.networks) { - console.log(redirects[frontend][network]) + // console.log(redirects[frontend][network]) switch (network) { case "clearnet": browser.storage.local.set({ @@ -416,8 +413,8 @@ function initDefaults() { break default: browser.storage.local.set({ - [frontend + camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], - [frontend + camelCase(network) + "CustomRedirects"]: [], + [frontend + utils.camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], + [frontend + utils.camelCase(network) + "CustomRedirects"]: [], }) } } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 50ada765..9c5947a7 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -123,17 +123,16 @@ async function processDefaultCustomInstances(target, name, protocol, document) { let redirectsChecks = `${name}${camelCase(protocol)}RedirectsChecks` let customRedirects = `${name}${camelCase(protocol)}CustomRedirects` - let redirectsKey = `${target}Redirects` let redirects async function getFromStorage() { return new Promise(async resolve => - browser.storage.local.get([redirectsChecks, customRedirects, redirectsKey, latencyKey], r => { + browser.storage.local.get([redirectsChecks, customRedirects, "redirects", latencyKey], r => { nameDefaultRedirects = r[redirectsChecks] nameCustomInstances = r[customRedirects] instancesLatency = r[latencyKey] ?? [] - redirects = r[redirectsKey] + redirects = r.redirects resolve() }) ) @@ -298,9 +297,9 @@ async function testLatency(element, instances, frontend) { let myList = {} let latencyThreshold let redirectsChecks = [] - browser.storage.local.get(["latencyThreshold", `${frontend}NormalRedirectsChecks`], r => { + browser.storage.local.get(["latencyThreshold", `${frontend}ClearnetRedirectsChecks`], r => { latencyThreshold = r.latencyThreshold - redirectsChecks = r[`${frontend}NormalRedirectsChecks`] + redirectsChecks = r[`${frontend}ClearnetRedirectsChecks`] }) for (const href of instances) await ping(href).then(time => { @@ -315,7 +314,7 @@ async function testLatency(element, instances, frontend) { redirectsChecks.splice(redirectsChecks.indexOf(href), 1) } - browser.storage.local.set({ [`${frontend}NormalRedirectsChecks`]: redirectsChecks }) + browser.storage.local.set({ [`${frontend}ClearnetRedirectsChecks`]: redirectsChecks }) let text if (time == 5000) text = "5000ms+" @@ -516,10 +515,10 @@ function latency(name, frontend, document, location) { let redirects = r[key] const oldHtml = latencyLabel.innerHTML latencyLabel.innerHTML = "..." - testLatency(latencyLabel, redirects[frontend].normal, frontend).then(r => { + testLatency(latencyLabel, redirects[frontend].clearnet, frontend).then(r => { browser.storage.local.set({ [`${frontend}Latency`]: r }) latencyLabel.innerHTML = oldHtml - processDefaultCustomInstances(name, frontend, "normal", document) + processDefaultCustomInstances(name, frontend, "clearnet", document) latencyElement.removeEventListener("click", reloadWindow) }) }) @@ -537,4 +536,5 @@ export default { switchInstance, copyRaw, unify, + camelCase, } diff --git a/src/config/config.json b/src/config/config.json index 6c4d8026..97fd838c 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,19 +1,19 @@ { "networks": { "clearnet": { - "url": "org", + "tld": "org", "name": "Clearnet" }, "tor": { - "url": "onion", + "tld": "onion", "name": "Tor" }, "i2p": { - "url": "i2p", + "tld": "i2p", "name": "I2P" }, "loki": { - "url": "loki", + "tld": "loki", "name": "Lokinet" } }, @@ -72,14 +72,14 @@ "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" ], "name": "Youtube", - "defaults": { - "disableYoutube": false, - "enableYoutubeCustomSettings": false, - "onlyEmbeddedVideo": "both", - "youtubeFrontend": "invidious", - "youtubeEmbedFrontend": "invidious" - }, - "imageType": "png" + "options": { + "disabled": false, + "redirectType": "both", + "frontend": "invidious", + "embedFrontend": "invidious" + }, + "imageType": "png", + "embeddable": true }, "youtubeMusic": { "frontends": { @@ -88,11 +88,12 @@ }, "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], "name": "YT Music", - "defaults": { - "disableYoutubeMusic": false, - "youtubeMusicFrontend": "beatbump" + "options": { + "disabled": false, + "frontend": "beatbump" }, - "imageType": "png" + "imageType": "png", + "embeddable": false }, "twitter": { "frontends": { @@ -123,11 +124,12 @@ }, "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], "name": "Twitter", - "defaults": { - "disableTwitter": false, - "twitterRedirectType": "both" + "options": { + "disabled": false, + "redirectType": "both" }, - "imageType": "png" + "imageType": "png", + "embeddable": true }, "instagram": { "frontends": { @@ -141,10 +143,9 @@ }, "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], "name": "Instagram", - "defaults": { - "disableInstagram": false - }, - "imageType": "png" + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, "tiktok": { "frontends": { @@ -152,10 +153,9 @@ }, "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], "name": "TikTok", - "defaults": { - "disableTiktok": false - }, - "imageType": "png" + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, "reddit": { "frontends": { @@ -185,11 +185,12 @@ }, "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], "name": "Reddit", - "defaults": { - "disableReddit": false, - "redditFrontend": "libreddit" + "options": { + "disabled": false, + "frontend": "libreddit" }, - "imageType": "png" + "imageType": "png", + "embeddable": false }, "imgur": { "frontends": { @@ -199,8 +200,9 @@ }, "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], "name": "Imgur", - "defaults": { "disableImgur": false }, - "imageType": "png" + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, "wikipedia": { "frontends": { @@ -212,8 +214,9 @@ }, "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], "name": "Wikipedia", - "defaults": { "disableWikipedia": true }, - "imageType": "svg" + "options": { "disabled": true }, + "imageType": "svg", + "embeddable": false }, "medium": { "frontends": { @@ -242,8 +245,9 @@ "^writingcooperative\\.com " ], "name": "Medium", - "defaults": { "disableMedium": false }, - "imageType": "svg" + "options": { "disabled": false }, + "imageType": "svg", + "embeddable": false }, "quora": { "frontends": { @@ -253,10 +257,9 @@ }, "targets": ["^https?:\\/{2}([a-z]+\\.)*quora\\.com.*"], "name": "Quora", - "defaults": { - "disableQuora": false - }, - "imageType": "png" + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, "imdb": { "frontends": { @@ -266,10 +269,9 @@ }, "targets": ["^https?:\\/{2}(?:www\\.|)imdb\\.com.*"], "name": "IMDb", - "defaults": { - "disableImdb": true - }, - "imageType": "svg" + "options": { "disabled": true }, + "imageType": "svg", + "embeddable": false }, "reuters": { "frontends": { @@ -279,10 +281,9 @@ }, "targets": ["^https?:\\/{2}(www\\.|)reuters\\.com.*"], "name": "Reuters", - "defaults": { - "disableReuters": true - }, - "imageType": "svg" + "options": { "disabled": true }, + "imageType": "svg", + "embeddable": false }, "peertube": { "frontends": { @@ -292,10 +293,9 @@ }, "targets": "datajson", "name": "PeerTube", - "defaults": { - "disablePeertube": true - }, - "imageType": "svg" + "options": { "disabled": true }, + "imageType": "svg", + "embeddable": false }, "lbry": { "frontends": { @@ -309,12 +309,13 @@ "singleInstanceFrontends": ["lbryDesktop"], "targets": ["^https?:\\/{2}odysee\\.com", "^https?:\\/{2}lbry\\.tv"], "name": "LBRY", - "defaults": { - "disableLbry": true, - "lbryFrontend": "librarian", - "lbryRedirectType": "both" + "options": { + "disabled": true, + "frontend": "librarian", + "redirectType": "both" }, - "imageType": "png" + "imageType": "png", + "embeddable": true }, "search": { "frontends": { @@ -377,12 +378,12 @@ }, "targets": ["^https?:\\/{2}search\\.libredirect\\.invalid"], "name": "Search", - "defaults": { - "disableSearch": false, - "searchFrontend": "searxng", - "searxngCustomSettings": false + "options": { + "disabled": false, + "frontend": "searxng" }, - "imageType": "svg" + "imageType": "svg", + "embeddable": false }, "translate": { "frontends": { @@ -399,11 +400,12 @@ }, "targets": ["^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/"], "name": "Translate", - "defaults": { - "translateDisable": false, - "translateFrontend": "simplyTranslate" + "options": { + "disabled": false, + "frontend": "simplyTranslate" }, - "imageType": "svg" + "imageType": "svg", + "embeddable": false }, "maps": { "frontends": { @@ -414,11 +416,12 @@ "singleInstanceFrontends": ["osm"], "targets": ["^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)"], "name": "Maps", - "defaults": { - "disableMaps": false, - "mapsFrontend": "osm" + "options": { + "disabled": false, + "frontend": "osm" }, - "imageType": "svg" + "imageType": "svg", + "embeddable": false }, "sendTargets": { "frontends": { @@ -428,10 +431,9 @@ }, "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid\\/$", "^https?:\\/{2}send\\.firefox\\.com\\/$", "^https?:\\/{2}sendfiles\\.online\\/$"], "name": "Send Files", - "defaults": { - "disableSendTargets": false - }, - "imageType": "svg" + "options": { "disabled": false }, + "imageType": "svg", + "embeddable": false } } } diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 077b3da2..5c0aedd5 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -78,7 +78,7 @@

+
+
+

Frontend

+ +
+ <% if (config.services[service].embeddable) { %> + <% if (config.services[service].singleInstanceFrontends) { %> +
+
+

Embedded Videos Frontend

+ +
+
+ <% } %> +
+

Redirect Type

+ +
+ <% } %> +
+ <% config.services[service].frontends.forEach(frontend=>{ %> +
+ <% config.networks.forEach(network=>{ %> +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ <% if (network == "clearnet") { %> +
+ + +
+ <% } %> +
+ <% }); %> + <% }); %> +
+<% }); %> + \ No newline at end of file diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js new file mode 100644 index 00000000..5f370a18 --- /dev/null +++ b/src/pages/options/widgets/services.js @@ -0,0 +1,81 @@ +import utils from "../../../assets/javascripts/utils.js" + +// const frontends = new Array("librarian") +// const protocols = new Array("clearnet", "tor", "i2p", "loki") + +let config, + network, + divs = {} + +async function getConfig() { + return new Promise(resolve => { + fetch("/config/config.json") + .then(response => response.text()) + .then(data => { + config = JSON.parse(data) + resolve() + }) + }) +} + +getConfig() + +browser.storage.local.get("network", r => { + network = r.network +}) + +function changeFrontendsSettings(service) { + for (const frontend in config.services[service].frontends) { + const frontendDiv = document.getElementById(frontend) + if (frontend == divs[service].frontend.value) { + frontendDiv.style.display = "block" + } else { + frontendDiv.style.display = "none" + } + } +} + +function changeNetworkSettings(selectedNetwork) { + for (const frontend in config.frontends) { + const frontendDiv = document.getElementById(frontend) + for (const network in config.networks) { + const networkDiv = frontendDiv.getElementsByClassName(network)[0] + if (network == selectedNetwork) { + networkDiv.style.display = "block" + } else { + networkDiv.style.display = "none" + } + } + } +} + +for (service in config.services) { + divs[service][service] = document.getElementById(`${service}_page`) + for (const option in config.services[service].options) { + divs[service][option] = document.getElementById(`${service}-${option}`) + + browser.storage.local.get([`${service + utils.camelCase(option)}`], r => { + if (typeof config.services[service].options[option] == "boollean") divs[service][option].checked = !r[service + utils.camelCase(option)] + else divs[service][option].value = !r[service + utils.camelCase(option)] + }) + + divs[service][option].addEventListener("change", () => { + if (typeof config.services[service].options[option] == "boollean") { + browser.storage.local.set({ [service + utils.camelCase(option)]: !divs[service][option].checked }) + } else { + browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].value }) + } + changeFrontendsSettings() + }) + } + + changeFrontendsSettings(service) + changeNetworkSettings(network) + + for (const frontend in config.services[service].frontends) { + for (const network in config.networks) { + utils.processDefaultCustomInstances(service, frontend, network, document) + } + utils.latency(service, frontend, document, location) + } +} diff --git a/src/pages/options/widgets/tiktok.js b/src/pages/options/widgets/tiktok.js index 38ec9ea0..f382ad5a 100644 --- a/src/pages/options/widgets/tiktok.js +++ b/src/pages/options/widgets/tiktok.js @@ -3,7 +3,7 @@ import utils from "../../../assets/javascripts/utils.js" // UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST const frontends = new Array("proxiTok") -const protocols = new Array("normal", "tor", "i2p", "loki") +const protocols = new Array("clearnet", "tor", "i2p", "loki") const enable = document.getElementById("tiktok-enable") const tiktok = document.getElementById("tiktok_page") @@ -39,7 +39,7 @@ function changeProtocolSettings() { browser.storage.local.get(["disableTiktok", "protocol"], r => { enable.checked = !r.disableTiktok - protocol = r.protocol + protocol = r.network changeProtocolSettings() }) diff --git a/src/pages/options/widgets/tiktok.pug b/src/pages/options/widgets/tiktok.pug index 29ab5e2a..986bd270 100644 --- a/src/pages/options/widgets/tiktok.pug +++ b/src/pages/options/widgets/tiktok.pug @@ -8,7 +8,7 @@ section#tiktok_page.option-block #proxiTok hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://proxitok.com') include ../../widgets/latency.pug diff --git a/src/pages/options/widgets/translate.js b/src/pages/options/widgets/translate.js index e1008139..c70b679f 100644 --- a/src/pages/options/widgets/translate.js +++ b/src/pages/options/widgets/translate.js @@ -1,7 +1,7 @@ import utils from "../../../assets/javascripts/utils.js" const frontends = new Array("simplyTranslate", "lingva") -const protocols = new Array("normal", "tor", "i2p", "loki") +const protocols = new Array("clearnet", "tor", "i2p", "loki") const enable = document.getElementById("translate-enable") const translate = document.getElementById("translate_page") @@ -36,7 +36,7 @@ function changeProtocolSettings() { browser.storage.local.get(["translateDisable", "translateFrontend", "protocol"], r => { enable.checked = !r.translateDisable frontend.value = r.translateFrontend - protocol = r.protocol + protocol = r.network changeFrontendsSettings() changeProtocolSettings() }) diff --git a/src/pages/options/widgets/translate.pug b/src/pages/options/widgets/translate.pug index 4836c0f3..40d42bca 100644 --- a/src/pages/options/widgets/translate.pug +++ b/src/pages/options/widgets/translate.pug @@ -14,7 +14,7 @@ section#translate_page.option-block hr #simplyTranslate - .normal + .clearnet include ../../widgets/instances.pug +instances('https://simplytranslate.org') include ../../widgets/latency.pug @@ -30,7 +30,7 @@ section#translate_page.option-block +instances('http://simplytranslate.loki') #lingva - .normal + .clearnet include ../../widgets/instances.pug +instances('https://lingvatranslate.com') +latency('lingva') diff --git a/src/pages/options/widgets/twitter.js b/src/pages/options/widgets/twitter.js index 5ad760b3..52d7a73b 100644 --- a/src/pages/options/widgets/twitter.js +++ b/src/pages/options/widgets/twitter.js @@ -3,7 +3,7 @@ import utils from "../../../assets/javascripts/utils.js" // UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST const frontends = new Array("nitter") -const protocols = new Array("normal", "tor", "i2p", "loki") +const protocols = new Array("clearnet", "tor", "i2p", "loki") const enable = document.getElementById("twitter-enable") const twitter = document.getElementById("twitter_page") @@ -40,7 +40,7 @@ function changeProtocolSettings() { browser.storage.local.get(["disableTwitter", "protocol", "twitterRedirectType"], r => { enable.checked = !r.disableTwitter - protocol = r.protocol + protocol = r.network redirectType.value = r.twitterRedirectType changeProtocolSettings() }) diff --git a/src/pages/options/widgets/twitter.pug b/src/pages/options/widgets/twitter.pug index 6e610545..fa7f1320 100644 --- a/src/pages/options/widgets/twitter.pug +++ b/src/pages/options/widgets/twitter.pug @@ -15,7 +15,7 @@ section#twitter_page.option-block #nitter hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://nitter.com') include ../../widgets/latency.pug diff --git a/src/pages/options/widgets/wikipedia.js b/src/pages/options/widgets/wikipedia.js index 9d06488b..120af919 100644 --- a/src/pages/options/widgets/wikipedia.js +++ b/src/pages/options/widgets/wikipedia.js @@ -3,7 +3,7 @@ import utils from "../../../assets/javascripts/utils.js" // UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST const frontends = new Array("wikiless") -const protocols = new Array("normal", "tor", "i2p", "loki") +const protocols = new Array("clearnet", "tor", "i2p", "loki") const enable = document.getElementById("wikipedia-enable") const wikipedia = document.getElementById("wikipedia_page") @@ -39,7 +39,7 @@ function changeProtocolSettings() { browser.storage.local.get(["disableWikipedia", "protocol"], r => { enable.checked = !r.disableWikipedia - protocol = r.protocol + protocol = r.network changeProtocolSettings() }) diff --git a/src/pages/options/widgets/wikipedia.pug b/src/pages/options/widgets/wikipedia.pug index c9aee64c..a0ad37c3 100644 --- a/src/pages/options/widgets/wikipedia.pug +++ b/src/pages/options/widgets/wikipedia.pug @@ -8,7 +8,7 @@ section#wikipedia_page.option-block #wikiless hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://wikiless.com') include ../../widgets/latency.pug diff --git a/src/pages/options/widgets/youtube.js b/src/pages/options/widgets/youtube.js index 065a195b..4e4bbbae 100644 --- a/src/pages/options/widgets/youtube.js +++ b/src/pages/options/widgets/youtube.js @@ -1,7 +1,7 @@ import utils from "../../../assets/javascripts/utils.js" const frontends = new Array("invidious", "piped", "pipedMaterial", "cloudtube") -const protocols = new Array("normal", "tor", "i2p", "loki") +const protocols = new Array("clearnet", "tor", "i2p", "loki") const singleInstanceFrontends = new Array("freetube", "yatte") const enable = document.getElementById("youtube-enable") @@ -66,7 +66,7 @@ browser.storage.local.get(["disableYoutube", "onlyEmbeddedVideo", "youtubeRedire onlyEmbeddedVideo.value = r.onlyEmbeddedVideo youtubeEmbedFrontend.value = r.youtubeEmbedFrontend frontend.value = r.youtubeFrontend - protocol = r.protocol + protocol = r.network changeFrontendsSettings() changeProtocolSettings() diff --git a/src/pages/options/widgets/youtube.pug b/src/pages/options/widgets/youtube.pug index 33a43c34..cf48d9be 100644 --- a/src/pages/options/widgets/youtube.pug +++ b/src/pages/options/widgets/youtube.pug @@ -34,7 +34,7 @@ section#youtube_page.option-block #invidious hr - .normal + .clearnet include ../../widgets/instances.pug +instances('http://invidious.com') include ../../widgets/latency.pug @@ -51,7 +51,7 @@ section#youtube_page.option-block #piped hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://piped.com') include ../../widgets/latency.pug @@ -68,7 +68,7 @@ section#youtube_page.option-block #pipedMaterial hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://piped-material.com') include ../../widgets/latency.pug @@ -85,7 +85,7 @@ section#youtube_page.option-block #cloudtube hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://cloudtube.com') include ../../widgets/latency.pug diff --git a/src/pages/options/widgets/youtubeMusic.js b/src/pages/options/widgets/youtubeMusic.js index ad51ce7c..bb985b28 100644 --- a/src/pages/options/widgets/youtubeMusic.js +++ b/src/pages/options/widgets/youtubeMusic.js @@ -1,7 +1,7 @@ import utils from "../../../assets/javascripts/utils.js" const frontends = new Array("beatbump", "hyperpipe") -const protocols = new Array("normal", "tor", "i2p", "loki") +const protocols = new Array("clearnet", "tor", "i2p", "loki") let enable = document.getElementById("youtubeMusic-enable") const youtubeMusic = document.getElementById("youtubeMusic_page") @@ -36,7 +36,7 @@ function changeProtocolSettings() { browser.storage.local.get(["disableYoutubeMusic", "youtubeMusicFrontend", "protocol"], r => { enable.checked = !r.disableYoutubeMusic frontend.value = r.youtubeMusicFrontend - protocol = r.protocol + protocol = r.network changeFrontendsSettings() changeProtocolSettings() }) diff --git a/src/pages/options/widgets/youtubeMusic.pug b/src/pages/options/widgets/youtubeMusic.pug index bcba3d2d..9c2c08cf 100644 --- a/src/pages/options/widgets/youtubeMusic.pug +++ b/src/pages/options/widgets/youtubeMusic.pug @@ -14,7 +14,7 @@ section#youtubeMusic_page.option-block #beatbump hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://beatbump.org') include ../../widgets/latency.pug @@ -31,7 +31,7 @@ section#youtubeMusic_page.option-block #hyperpipe hr - .normal + .clearnet include ../../widgets/instances.pug +instances('https://hyperpipe.org') include ../../widgets/latency.pug -- cgit 1.4.1 From 09b2b961164051314813fdf9984881b3a3124874 Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 13 Sep 2022 21:15:52 +0100 Subject: add files --- src/assets/images/medium-icon.svg | 5 +++++ src/pages/widgets/head.ejs | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/assets/images/medium-icon.svg create mode 100644 src/pages/widgets/head.ejs diff --git a/src/assets/images/medium-icon.svg b/src/assets/images/medium-icon.svg new file mode 100644 index 00000000..2939a189 --- /dev/null +++ b/src/assets/images/medium-icon.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/pages/widgets/head.ejs b/src/pages/widgets/head.ejs new file mode 100644 index 00000000..d9e3802a --- /dev/null +++ b/src/pages/widgets/head.ejs @@ -0,0 +1,8 @@ + + + + + + General + + -- cgit 1.4.1 From e867e2e0a50c76e407117136443bd1ddd9f10ac9 Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 14 Sep 2022 21:04:27 +0100 Subject: Fixed ejs ending tags --- src/pages/options/widgets/services.ejs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pages/options/widgets/services.ejs b/src/pages/options/widgets/services.ejs index 14365871..a1b0a538 100644 --- a/src/pages/options/widgets/services.ejs +++ b/src/pages/options/widgets/services.ejs @@ -1,30 +1,30 @@ <% config.services.forEach(service=>{ %> -
+
-

<%= config.services[service].name =%>

+

<%= config.services[service].name %>


Enable

- +

Frontend

- <% config.services[service].frontends.forEach(frontend=>{ %> - + <% }); %> <% config.services[service].singleInstanceFrontends.forEach(frontend=>{ %> - + <% }); %>
<% if (config.services[service].embeddable) { %> <% if (config.services[service].singleInstanceFrontends) { %> -
+

Embedded Videos Frontend

- <% config.services[service].frontends.forEach(frontend=>{ %> <% }); %> @@ -43,9 +43,9 @@ <% } %>
<% config.services[service].frontends.forEach(frontend=>{ %> -
+
<% config.networks.forEach(network=>{ %> -
+

Default Instances

@@ -56,7 +56,7 @@
- +
@@ -81,4 +81,4 @@ <% }); %>
<% }); %> - \ No newline at end of file + -- cgit 1.4.1 From 4c1099771caba798573f147fc08e5a474fc7a81b Mon Sep 17 00:00:00 2001 From: Hygna Date: Fri, 16 Sep 2022 19:33:39 +0100 Subject: More ejs progress --- src/assets/images/about-icon.svg | 3 +++ src/assets/images/general-icon.svg | 0 src/assets/images/maps-icon.svg | 3 +++ src/assets/images/search-icon.svg | 3 +++ src/assets/images/translate-icon.svg | 3 +++ src/pages/options/index.ejs | 13 +++++++++++++ src/pages/widgets/links.ejs | 7 +++++++ 7 files changed, 32 insertions(+) create mode 100644 src/assets/images/about-icon.svg create mode 100644 src/assets/images/general-icon.svg create mode 100644 src/assets/images/maps-icon.svg create mode 100644 src/assets/images/search-icon.svg create mode 100644 src/assets/images/translate-icon.svg create mode 100644 src/pages/options/index.ejs create mode 100644 src/pages/widgets/links.ejs diff --git a/src/assets/images/about-icon.svg b/src/assets/images/about-icon.svg new file mode 100644 index 00000000..551255e6 --- /dev/null +++ b/src/assets/images/about-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/general-icon.svg b/src/assets/images/general-icon.svg new file mode 100644 index 00000000..e69de29b diff --git a/src/assets/images/maps-icon.svg b/src/assets/images/maps-icon.svg new file mode 100644 index 00000000..c66a89d1 --- /dev/null +++ b/src/assets/images/maps-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/search-icon.svg b/src/assets/images/search-icon.svg new file mode 100644 index 00000000..cb73ff15 --- /dev/null +++ b/src/assets/images/search-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/translate-icon.svg b/src/assets/images/translate-icon.svg new file mode 100644 index 00000000..30f9c1b7 --- /dev/null +++ b/src/assets/images/translate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/options/index.ejs b/src/pages/options/index.ejs new file mode 100644 index 00000000..c17d1f0a --- /dev/null +++ b/src/pages/options/index.ejs @@ -0,0 +1,13 @@ + + + <%- include('../widgets/head') %> + +
+ <%- include('../widgets/links', {config: config}) %> + <%- include('widgets/general', {config: config}) %> + <%- include('widgets/services', {config: config}) %> + <%- include('widgets/about') %> +
+ + + diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs new file mode 100644 index 00000000..eacfe91b --- /dev/null +++ b/src/pages/widgets/links.ejs @@ -0,0 +1,7 @@ +
-- cgit 1.4.1 From 978e07930705e87b04d0eafe86233bb62fb36c03 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sun, 18 Sep 2022 17:03:54 +0100 Subject: Converted index.html to ejs --- package.json | 3 +- src/assets/images/general-icon.svg | 3 + src/assets/images/imdb-icon.svg | 57 + src/assets/images/imdb.svg | 57 - src/assets/images/imgur-icon.png | Bin 0 -> 26675 bytes src/assets/images/imgur.png | Bin 26675 -> 0 bytes src/assets/images/medium-icon.svg | 10 +- src/assets/images/quora-icon.png | Bin 0 -> 5499 bytes src/assets/images/quora.png | Bin 5499 -> 0 bytes src/assets/images/reuters-icon.svg | 1 + src/assets/images/reuters.svg | 1 - src/assets/images/send-icon.svg | 51 - src/assets/images/sendTargets-icon.svg | 51 + src/assets/images/youtube-music-icon.png | Bin 25903 -> 0 bytes src/assets/images/youtubeMusic-icon.png | Bin 0 -> 25903 bytes src/assets/javascripts/services.js | 3 +- src/assets/javascripts/utils.js | 7 +- src/config/config.json | 822 ++-- src/pages/options/index.ejs | 10 +- src/pages/options/index.html | 6767 +++++++++++++++------------- src/pages/options/index.pug | 36 - src/pages/options/widgets/about.pug | 17 - src/pages/options/widgets/general.ejs | 97 + src/pages/options/widgets/general.pug | 210 - src/pages/options/widgets/imdb.pug | 26 - src/pages/options/widgets/imgur.pug | 27 - src/pages/options/widgets/instagram.pug | 27 - src/pages/options/widgets/lbry.pug | 39 - src/pages/options/widgets/maps.pug | 32 - src/pages/options/widgets/medium.pug | 26 - src/pages/options/widgets/peertube.pug | 26 - src/pages/options/widgets/quora.pug | 26 - src/pages/options/widgets/reddit.pug | 48 - src/pages/options/widgets/reuters.pug | 26 - src/pages/options/widgets/search.pug | 85 - src/pages/options/widgets/sendTargets.pug | 26 - src/pages/options/widgets/services.ejs | 43 +- src/pages/options/widgets/services.js | 3 +- src/pages/options/widgets/tiktok.pug | 26 - src/pages/options/widgets/translate.pug | 48 - src/pages/options/widgets/twitter.pug | 33 - src/pages/options/widgets/wikipedia.pug | 26 - src/pages/options/widgets/youtube.pug | 103 - src/pages/options/widgets/youtubeMusic.pug | 49 - src/pages/widgets/links.ejs | 4 +- 45 files changed, 4264 insertions(+), 4688 deletions(-) create mode 100644 src/assets/images/imdb-icon.svg delete mode 100644 src/assets/images/imdb.svg create mode 100644 src/assets/images/imgur-icon.png delete mode 100644 src/assets/images/imgur.png create mode 100644 src/assets/images/quora-icon.png delete mode 100644 src/assets/images/quora.png create mode 100644 src/assets/images/reuters-icon.svg delete mode 100644 src/assets/images/reuters.svg delete mode 100644 src/assets/images/send-icon.svg create mode 100644 src/assets/images/sendTargets-icon.svg delete mode 100644 src/assets/images/youtube-music-icon.png create mode 100644 src/assets/images/youtubeMusic-icon.png delete mode 100644 src/pages/options/index.pug delete mode 100644 src/pages/options/widgets/about.pug create mode 100644 src/pages/options/widgets/general.ejs delete mode 100644 src/pages/options/widgets/general.pug delete mode 100644 src/pages/options/widgets/imdb.pug delete mode 100644 src/pages/options/widgets/imgur.pug delete mode 100644 src/pages/options/widgets/instagram.pug delete mode 100644 src/pages/options/widgets/lbry.pug delete mode 100644 src/pages/options/widgets/maps.pug delete mode 100644 src/pages/options/widgets/medium.pug delete mode 100644 src/pages/options/widgets/peertube.pug delete mode 100644 src/pages/options/widgets/quora.pug delete mode 100644 src/pages/options/widgets/reddit.pug delete mode 100644 src/pages/options/widgets/reuters.pug delete mode 100644 src/pages/options/widgets/search.pug delete mode 100644 src/pages/options/widgets/sendTargets.pug delete mode 100644 src/pages/options/widgets/tiktok.pug delete mode 100644 src/pages/options/widgets/translate.pug delete mode 100644 src/pages/options/widgets/twitter.pug delete mode 100644 src/pages/options/widgets/wikipedia.pug delete mode 100644 src/pages/options/widgets/youtube.pug delete mode 100644 src/pages/options/widgets/youtubeMusic.pug diff --git a/package.json b/package.json index 50872aac..ee0d9089 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test": "web-ext lint --source-dir ./src/ || true", "pug": "pug ./src/pages/options/*.pug ./src/pages/popup/ -P -w", "prettier": "npx prettier --write .", - "instances": "python3 src/instances/get_instances.py; git update-index --assume-unchanged src/instances/blacklist.json src/instances/data.json" + "instances": "python3 src/instances/get_instances.py; git update-index --assume-unchanged src/instances/blacklist.json src/instances/data.json", + "ejs": "npx ejs src/pages/options/index.ejs -f src/config/config.json -o src/pages/options/index.html" }, "repository": { "type": "git", diff --git a/src/assets/images/general-icon.svg b/src/assets/images/general-icon.svg index e69de29b..55c5f8bc 100644 --- a/src/assets/images/general-icon.svg +++ b/src/assets/images/general-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/imdb-icon.svg b/src/assets/images/imdb-icon.svg new file mode 100644 index 00000000..a3f4103c --- /dev/null +++ b/src/assets/images/imdb-icon.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + diff --git a/src/assets/images/imdb.svg b/src/assets/images/imdb.svg deleted file mode 100644 index a3f4103c..00000000 --- a/src/assets/images/imdb.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - diff --git a/src/assets/images/imgur-icon.png b/src/assets/images/imgur-icon.png new file mode 100644 index 00000000..c23a45b2 Binary files /dev/null and b/src/assets/images/imgur-icon.png differ diff --git a/src/assets/images/imgur.png b/src/assets/images/imgur.png deleted file mode 100644 index c23a45b2..00000000 Binary files a/src/assets/images/imgur.png and /dev/null differ diff --git a/src/assets/images/medium-icon.svg b/src/assets/images/medium-icon.svg index 2939a189..72612486 100644 --- a/src/assets/images/medium-icon.svg +++ b/src/assets/images/medium-icon.svg @@ -1,5 +1,5 @@ - - - - - \ No newline at end of file + + + + + diff --git a/src/assets/images/quora-icon.png b/src/assets/images/quora-icon.png new file mode 100644 index 00000000..d2a06954 Binary files /dev/null and b/src/assets/images/quora-icon.png differ diff --git a/src/assets/images/quora.png b/src/assets/images/quora.png deleted file mode 100644 index d2a06954..00000000 Binary files a/src/assets/images/quora.png and /dev/null differ diff --git a/src/assets/images/reuters-icon.svg b/src/assets/images/reuters-icon.svg new file mode 100644 index 00000000..aab389c3 --- /dev/null +++ b/src/assets/images/reuters-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/reuters.svg b/src/assets/images/reuters.svg deleted file mode 100644 index aab389c3..00000000 --- a/src/assets/images/reuters.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/images/send-icon.svg b/src/assets/images/send-icon.svg deleted file mode 100644 index 2ed80a06..00000000 --- a/src/assets/images/send-icon.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - diff --git a/src/assets/images/sendTargets-icon.svg b/src/assets/images/sendTargets-icon.svg new file mode 100644 index 00000000..2ed80a06 --- /dev/null +++ b/src/assets/images/sendTargets-icon.svg @@ -0,0 +1,51 @@ + + + + + + + + + diff --git a/src/assets/images/youtube-music-icon.png b/src/assets/images/youtube-music-icon.png deleted file mode 100644 index a33df696..00000000 Binary files a/src/assets/images/youtube-music-icon.png and /dev/null differ diff --git a/src/assets/images/youtubeMusic-icon.png b/src/assets/images/youtubeMusic-icon.png new file mode 100644 index 00000000..a33df696 Binary files /dev/null and b/src/assets/images/youtubeMusic-icon.png differ diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index b7ee2205..70928786 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -11,7 +11,8 @@ async function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - config = JSON.parse(data) + const tmp = JSON.parse(data) + config = tmp.config resolve() }) }) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 9c5947a7..7337a13d 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -23,6 +23,10 @@ function getRandomInstance(instances) { return instances[~~(instances.length * Math.random())] } +function camelCase(str) { + return str.charAt(0).toUpperCase() + str.slice(1) +} + let cloudflareBlackList = [] let authenticateBlackList = [] let offlineBlackList = [] @@ -107,9 +111,6 @@ function protocolHost(url) { } async function processDefaultCustomInstances(target, name, protocol, document) { - function camelCase(str) { - return str.charAt(0).toUpperCase() + str.slice(1) - } let latencyKey = `${name}Latency` let instancesLatency let nameProtocolElement = document.getElementById(name).getElementsByClassName(protocol)[0] diff --git a/src/config/config.json b/src/config/config.json index 97fd838c..7c391552 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,439 +1,459 @@ { - "networks": { - "clearnet": { - "tld": "org", - "name": "Clearnet" - }, - "tor": { - "tld": "onion", - "name": "Tor" - }, - "i2p": { - "tld": "i2p", - "name": "I2P" + "config": { + "networks": { + "clearnet": { + "tld": "org", + "name": "Clearnet" + }, + "tor": { + "tld": "onion", + "name": "Tor" + }, + "i2p": { + "tld": "i2p", + "name": "I2P" + }, + "loki": { + "tld": "loki", + "name": "Lokinet" + } }, - "loki": { - "tld": "loki", - "name": "Lokinet" - } - }, - "services": { - "youtube": { - "frontends": { - "invidious": { - "preferences": { - "cookies": ["PREFS"] + "services": { + "youtube": { + "frontends": { + "invidious": { + "preferences": { + "cookies": ["PREFS"] + } + }, + "piped": { + "preferences": { + "localstorage": [ + "bufferGoal", + "comments", + "disableLBRY", + "enabledCodecs", + "hl", + "homepage", + "instance", + "listen", + "minimizeDescription", + "playerAutoPlay", + "proxyLBRY", + "quality", + "region", + "selectedSkip", + "sponsorblock", + "theme", + "volume", + "watchHistory" + ] + } + }, + "pipedMaterial": { + "preferences": { + "localstorage": ["PREFERENCES"] + } + }, + "cloudtube": { + "preferences": { + "token": "token", + "fetchEndpoint": "/api/settings", + "setEndpoint": "/settings" + } } }, - "piped": { - "preferences": { - "localstorage": [ - "bufferGoal", - "comments", - "disableLBRY", - "enabledCodecs", - "hl", - "homepage", - "instance", - "listen", - "minimizeDescription", - "playerAutoPlay", - "proxyLBRY", - "quality", - "region", - "selectedSkip", - "sponsorblock", - "theme", - "volume", - "watchHistory" - ] - } + "singleInstanceFrontends": ["freetube", "yatte"], + "targets": [ + "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api)/.*|$)", + "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", + "^https?:\\/{2}youtu\\.be\\/..*", + "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" + ], + "name": "Youtube", + "options": { + "disabled": false, + "redirectType": "both", + "frontend": "invidious", + "embedFrontend": "invidious" }, - "pipedMaterial": { - "preferences": { - "localstorage": ["PREFERENCES"] + "imageType": "png", + "embeddable": true + }, + "youtubeMusic": { + "frontends": { + "beatbump": { + "preferences": { + "localstorage": ["settings"], + "indexeddb": "beatbump" + } + }, + "hyperpipe": { + "preferences": { + "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], + "indexeddb": ["hyperpipedb"] + } } }, - "cloudtube": { - "preferences": { - "token": "token", - "fetchEndpoint": "/api/settings", - "setEndpoint": "/settings" - } - } - }, - "singleInstanceFrontends": ["freetube", "yatte"], - "targets": [ - "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api)/.*|$)", - "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", - "^https?:\\/{2}youtu\\.be\\/..*", - "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" - ], - "name": "Youtube", - "options": { - "disabled": false, - "redirectType": "both", - "frontend": "invidious", - "embedFrontend": "invidious" - }, - "imageType": "png", - "embeddable": true - }, - "youtubeMusic": { - "frontends": { - "beatbump": {}, - "hyperpipe": {} - }, - "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], - "name": "YT Music", - "options": { - "disabled": false, - "frontend": "beatbump" + "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], + "name": "YT Music", + "options": { + "disabled": false, + "frontend": "beatbump" + }, + "imageType": "png", + "embeddable": false }, - "imageType": "png", - "embeddable": false - }, - "twitter": { - "frontends": { - "nitter": { - "preferences": { - "cookies": [ - "theme", - "infiniteScroll", - "stickyProfile", - "bidiSupport", - "hideTweetStats", - "hideBanner", - "hidePins", - "hideReplies", - "squareAvatars", - "mp4Playback", - "hlsPlayback", - "proxyVideos", - "muteVideos", - "autoplayGifs", - "replaceInstagram", - "replaceReddit", - "replaceTwitter", - "replaceYouTube" - ] + "twitter": { + "frontends": { + "nitter": { + "preferences": { + "cookies": [ + "theme", + "infiniteScroll", + "stickyProfile", + "bidiSupport", + "hideTweetStats", + "hideBanner", + "hidePins", + "hideReplies", + "squareAvatars", + "mp4Playback", + "hlsPlayback", + "proxyVideos", + "muteVideos", + "autoplayGifs", + "replaceInstagram", + "replaceReddit", + "replaceTwitter", + "replaceYouTube" + ] + } } - } - }, - "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], - "name": "Twitter", - "options": { - "disabled": false, - "redirectType": "both" + }, + "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], + "name": "Twitter", + "options": { + "disabled": false, + "redirectType": "both" + }, + "imageType": "png", + "embeddable": true }, - "imageType": "png", - "embeddable": true - }, - "instagram": { - "frontends": { - "bibliogram": { - "preferences": { - "token": "token", - "fetchEndpoint": "/settings.json", - "setEndpoint": "/applysettings" + "instagram": { + "frontends": { + "bibliogram": { + "preferences": { + "token": "token", + "fetchEndpoint": "/settings.json", + "setEndpoint": "/applysettings" + } } - } - }, - "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], - "name": "Instagram", - "options": { "disabled": false }, - "imageType": "png", - "embeddable": false - }, - "tiktok": { - "frontends": { - "proxiTok": {} + }, + "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], + "name": "Instagram", + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, - "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], - "name": "TikTok", - "options": { "disabled": false }, - "imageType": "png", - "embeddable": false - }, - "reddit": { - "frontends": { - "libreddit": { - "preferences": { - "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] + "tiktok": { + "frontends": { + "proxiTok": { + "preferences": { + "cookies": ["api-test_endpoints", "theme"] + } } }, - "teddit": { - "preferences": { - "cookies": [ - "collapse_child_comments", - "domain_instagram", - "domain_twitter", - "domain_youtube", - "flairs", - "highlight_controversial", - "nsfw_enabled", - "post_media_max_height", - "show_upvoted_percentage", - "show_upvotes", - "theme", - "videos_muted" - ] - } - } + "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], + "name": "TikTok", + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, - "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], - "name": "Reddit", - "options": { - "disabled": false, - "frontend": "libreddit" - }, - "imageType": "png", - "embeddable": false - }, - "imgur": { - "frontends": { - "rimgo": { - "preferences": {} - } - }, - "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], - "name": "Imgur", - "options": { "disabled": false }, - "imageType": "png", - "embeddable": false - }, - "wikipedia": { - "frontends": { - "wikiless": { - "preferences": { - "cookies": ["theme", "default_lang"] + "reddit": { + "frontends": { + "libreddit": { + "preferences": { + "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] + } + }, + "teddit": { + "preferences": { + "cookies": [ + "collapse_child_comments", + "domain_instagram", + "domain_twitter", + "domain_youtube", + "flairs", + "highlight_controversial", + "nsfw_enabled", + "post_media_max_height", + "show_upvoted_percentage", + "show_upvotes", + "theme", + "videos_muted" + ] + } } - } - }, - "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], - "name": "Wikipedia", - "options": { "disabled": true }, - "imageType": "svg", - "embeddable": false - }, - "medium": { - "frontends": { - "scribe": { - "preferences": {} - } + }, + "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], + "name": "Reddit", + "options": { + "disabled": false, + "frontend": "libreddit" + }, + "imageType": "png", + "embeddable": false }, - "targets": [ - "(?:.*\\.)*(? - <%- include('../widgets/head') %> + <%- include('src/pages/widgets/head') %> + <%- include('src/pages/widgets/links', {config: config}) %>
- <%- include('../widgets/links', {config: config}) %> - <%- include('widgets/general', {config: config}) %> - <%- include('widgets/services', {config: config}) %> - <%- include('widgets/about') %> + <%- include('src/pages/options/widgets/general', {config: config}) %> + <%- include('src/pages/options/widgets/services', {config: config}) %> + <%- include('src/pages/options/widgets/about') %>
diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 5c0aedd5..8908c9bf 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -1,3189 +1,3600 @@ - - - - - General - - + + + + + General + + + - + +
+
+

General

+
+
+
+

Theme

+ +
+
+

+ +
+
+
+

Fallback to normal if no instances are available for the current protocol

+ +
+
+
+

+ +
+ +
+

Latency Threshold

+ + +
+ +
+

+
+
+
+
+   +   +
+ +
+
+
+ +
+ +     + + +   + Export Settings    + + + + + Reset Settings +
+
+
+

Customize Popup

+
+ + +
+ + +
+
+

Youtube

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + +
+
+

Embed Frontend

+ +
+
+ + +
+

Redirect Type

+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
-

General

-
-
-
-

Theme

- -
-
-

- -
-
-
-

Fallback to normal if no instances are available for the current protocol

- -
-
-
-

- -
- -
-

Latency Threshold

- - -
-
-
-

-
-
-
-
-   -   -
- -
-
-
- -
- -     - - -   - Export Settings    - - - - - Reset Settings -
-
-
-

Customize Popup

-
- - -
-
-
-

YouTube

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-

Embedded Videos Frontend

- -
-
-
-

Redirect Type

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

YouTube Music

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Twitter

-
-
-
-

Enable

- -
-
-

Redirect Type

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Instagram

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

TikTok

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Reddit

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Imgur

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Wikipedia

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Medium

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Quora

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

IMDb

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Reuters

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

PeerTube

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

LBRY

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-

Redirect Type

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Search

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-

Note: To use Search, make LibRedirect the Default Search Engine

-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Translate

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Maps

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Send Files

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
+ + +
+ +
+ +
+ + +
+ + + +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + + +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

YT Music

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Twitter

+
+
+
+

Enable

+ +
+ + + +
+

Redirect Type

+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Instagram

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
-

About

-
-
- -
+ + + + +
+ + + +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + + + + +
+
+

TikTok

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Reddit

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Imgur

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Wikipedia

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Medium

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Quora

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

IMDb

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Reuters

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

PeerTube

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

LBRY

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+

Redirect Type

+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Search

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Translate

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Maps

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Send Files

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ + + +
+
+

About

+
+
+ +
+ - \ No newline at end of file + diff --git a/src/pages/options/index.pug b/src/pages/options/index.pug deleted file mode 100644 index 3711fdac..00000000 --- a/src/pages/options/index.pug +++ /dev/null @@ -1,36 +0,0 @@ -doctype html -html#elementToShowWithJavaScript(lang="en") - head - meta(charset='utf-8') - meta(name="viewport" content="width=device-width, initial-scale=1") - link(rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg") - link(href="../stylesheets/styles.css" rel="stylesheet") - title General - - script(type="module" src="./init.js") - body.option(dir="auto") - include ../widgets/links.pug - +links('general') - div#pages - include ./widgets/general.pug - include ./widgets/youtube.pug - include ./widgets/youtubeMusic.pug - include ./widgets/twitter.pug - include ./widgets/instagram.pug - include ./widgets/tiktok.pug - include ./widgets/reddit.pug - include ./widgets/imgur.pug - include ./widgets/wikipedia.pug - include ./widgets/medium.pug - include ./widgets/quora.pug - include ./widgets/imdb.pug - include ./widgets/reuters.pug - include ./widgets/peertube.pug - include ./widgets/lbry.pug - include ./widgets/search.pug - include ./widgets/translate.pug - include ./widgets/maps.pug - include ./widgets/sendTargets.pug - include ./widgets/about.pug - - script(type="module" src="./index.js") diff --git a/src/pages/options/widgets/about.pug b/src/pages/options/widgets/about.pug deleted file mode 100644 index 954522bb..00000000 --- a/src/pages/options/widgets/about.pug +++ /dev/null @@ -1,17 +0,0 @@ -section#about_page.option-block - .some-block.option-block - h1(data-localise="__MSG_about__") About - hr - .about - .some-block.option-block - h4 Donate: ♥️ - h4 https://libredirect.github.io/donate - .some-block.option-block - h4 FAQ: - h4 https://libredirect.github.io/faq - .some-block.option-block - h4 Docs: - h4 https://libredirect.github.io/docs - .some-block.option-block - h4 Source Code: - h4 https://libredirect.github.io/source_code \ No newline at end of file diff --git a/src/pages/options/widgets/general.ejs b/src/pages/options/widgets/general.ejs new file mode 100644 index 00000000..05ef0959 --- /dev/null +++ b/src/pages/options/widgets/general.ejs @@ -0,0 +1,97 @@ +
+
+

General

+
+
+
+

Theme

+ +
+
+

+ +
+
+
+

Fallback to normal if no instances are available for the current protocol

+ +
+
+
+

+ +
+
+
+

Latency Threshold

+ + +
+
+
+

+
+
+
+
+   +   +
+ +
+
+
+ +
+ +     + + +   + Export Settings    + + + + + Reset Settings +
+
+
+

Customize Popup

+
+ + +
diff --git a/src/pages/options/widgets/general.pug b/src/pages/options/widgets/general.pug deleted file mode 100644 index be3d495e..00000000 --- a/src/pages/options/widgets/general.pug +++ /dev/null @@ -1,210 +0,0 @@ -section#general_page.option-block - .some-block.option-block - h1(data-localise="__MSG_general__") General - hr - - .some-block.option-block - h4(data-localise="__MSG_theme__") Theme - select#theme - option(value="DEFAULT" data-localise="__MSG_system__") System - option(value="light" data-localise="__MSG_light__") Light - option(value="dark" data-localise="__MSG_dark__") Dark - - //- .some-block.option-block - h4 Tor Browser - input#firstPartyIsolate(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_protocol__") - select#protocol - option(value="clearnet" data-localise="__MSG_normal__") Clearnet - option(value="tor") Tor - option(value="i2p") I2P - option(value="loki") Lokinet - - #protocol-fallback - .some-block.option-block - h4(data-localise="__MSG_protocolFallback__") Fallback to normal if no instances are available for the current protocol - input#protocol-fallback-checkbox(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_autoRedirect__") - input#auto-redirect(type="checkbox") - - form - .some-block.option-block - h4(data-localise="__MSG_latencyThreshold") Latency Threshold - output#latency-output(for="latencyInput" name="latencyOutput") - input#latency-input(type="range" min="50" max="5000" value="1000" name="latencyInput" step="50") - - .some-block.option-block - h4(data-localise="__MSG_exceptions__") - - form#custom-exceptions-instance-form - .some-block.option-block - .some-block(style="padding:0;") - input#exceptions-custom-instance(placeholder="https://www.google.com" type="url") - |  - select#exceptions-custom-instance-type - option(value="url") URL - option(value="regex") Regex - |  - button#exceptions-add-instance.add(type="submit") - svg(xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor") - path(d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z") - - #exceptions-custom-checklist.checklist - - .buttons.buttons-inline - a#update-instances.button.button-inline - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z") - x(data-localise="__MSG_updateInstances__") Update Instances - - |    - - .buttons.buttons-inline - - label#import_settings_text.button.button-inline(for="import-settings") - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z") - |  - x(data-localise="__MSG_importSettings__") Import Settings - input#import-settings.button.button-inline(type="file" style="display:none;") - - |    - - a#export-settings.button.button-inline - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z") - |  - x(data-localise="__MSG_exportSettings__") Export Settings - - |    - - a#reset-settings.button.button-inline - svg(xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M12,5V2L8,6l4,4V7c3.31,0,6,2.69,6,6c0,2.97-2.17,5.43-5,5.91v2.02c3.95-0.49,7-3.85,7-7.93C20,8.58,16.42,5,12,5z") - path(d="M6,13c0-1.65,0.67-3.15,1.76-4.24L6.34,7.34C4.9,8.79,4,10.79,4,13c0,4.08,3.05,7.44,7,7.93v-2.02 C8.17,18.43,6,15.97,6,13z") - x(data-localise="__MSG_resetSettings__") Reset Settings - hr - - .some-block.option-block - h4(data-localise="__MSG_customPopup__") Customize Popup - - #popup-frontends-checklist.checklist-popup - div - div - img(src="../../../assets/images/youtube-icon.png") - x(data-localise="__MSG_youtube__") YouTube - input#youtube(type="checkbox") - div - div - img(src="../../../assets/images/youtube-music-icon.png") - x(data-localise="__MSG_ytmusic__") YoutubeMusic - input#youtubeMusic(type="checkbox") - div - div - img(src="../../../assets/images/twitter-icon.png") - x(data-localise="__MSG_twitter__") Twitter - input#twitter(type="checkbox") - - div - div - img(src="../../../assets/images/instagram-icon.png") - x(data-localise="__MSG_instagram__") Instagram - input#instagram(type="checkbox") - - div - div - img(src="../../../assets/images/tiktok-icon.png") - x(data-localise="__MSG_tiktok__") TikTok - input#tiktok(type="checkbox") - - div - div - img(src="../../../assets/images/imgur.png") - x(data-localise="__MSG_imgur__") Imgur - input#imgur(type="checkbox") - - div - div - img(src="../../../assets/images/reddit-icon.png") - x(data-localise="__MSG_reddit__") Reddit - input#reddit(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z") - x(data-localise="__MSG_search__") Search - input#search(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z") - x(data-localise="__MSG_translate__") Translate - input#translate(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z") - x(data-localise="__MSG_maps__") Maps - input#maps(type="checkbox") - - div - div - img(src="../../../assets/images/wikipedia-icon.svg") - x(data-localise="__MSG_wikipedia__") Wikipedia - input#wikipedia(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor") - circle(cx="500" cy="500" r="500") - ellipse(ry="475" rx="250" cy="501" cx="1296") - ellipse(cx="1682" cy="502" rx="88" ry="424") - x(data-localise="__MSG_medium__") Medium - input#medium(type="checkbox") - - div - div - img(src="../../../assets/images/quora.png") - x(data-localise="__MSG_quora__") Quora - input#quora(type="checkbox") - - div - div - img(src="../../../assets/images/imdb.svg") - x(data-localise="__MSG_imdb__") IMDb - input#imdb(type="checkbox") - - div - div - img(src="../../../assets/images/reuters.svg") - x(data-localise="__MSG_reuters__") Reuters - input#reuters(type="checkbox") - - div - div - img(src="../../../assets/images/peertube-icon.svg") - x(data-localise="__MSG_peertube__") PeerTube - input#peertube(type="checkbox") - - div - div - img(src="../../../assets/images/lbry-icon.png") - x(data-localise="__MSG_lbry__") LBRY - input#lbry(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z") - x(data-localise="__MSG_sendFiles__") Send Files - input#sendTargets(type="checkbox") - - - script(type="module" src="./widgets/general.js") diff --git a/src/pages/options/widgets/imdb.pug b/src/pages/options/widgets/imdb.pug deleted file mode 100644 index 67eb8eca..00000000 --- a/src/pages/options/widgets/imdb.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#imdb_page.option-block - .some-block.option-block - h1(data-localise="__MSG_imdb__") IMDb - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#imdb-enable(type="checkbox") - - #libremdb - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://libremdb.com') - include ../../widgets/latency.pug - +latency('libremdb') - .tor - include ../../widgets/instances.pug - +instances('http://libremdb.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://libremdb.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://libremdb.loki') - - script(type="module" src="./widgets/imdb.js") diff --git a/src/pages/options/widgets/imgur.pug b/src/pages/options/widgets/imgur.pug deleted file mode 100644 index 46c497ec..00000000 --- a/src/pages/options/widgets/imgur.pug +++ /dev/null @@ -1,27 +0,0 @@ -section#imgur_page.option-block - .some-block.option-block - h1(data-localise="__MSG_imgur__") Imgur - hr - - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#imgur-enable(type="checkbox") - - #rimgo - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://rimgo.com') - include ../../widgets/latency.pug - +latency('rimgo') - .tor - include ../../widgets/instances.pug - +instances('http://rimgo.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://rimgo.onion') - .loki - include ../../widgets/instances.pug - +instances('http://rimgo.loki') - - script(type="module" src="./widgets/imgur.js") diff --git a/src/pages/options/widgets/instagram.pug b/src/pages/options/widgets/instagram.pug deleted file mode 100644 index 702aa651..00000000 --- a/src/pages/options/widgets/instagram.pug +++ /dev/null @@ -1,27 +0,0 @@ -section#instagram_page.option-block - .some-block.option-block - h1(data-localise="__MSG_instagram__") Instagram - hr - - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#instagram-enable(type="checkbox") - - #bibliogram - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://bibliogram.com') - include ../../widgets/latency.pug - +latency('bibliogram') - .tor - include ../../widgets/instances.pug - +instances('https://bibliogram.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://bibliogram.onion') - .loki - include ../../widgets/instances.pug - +instances('http://bibliogram.loki') - - script(type="module" src="./widgets/instagram.js") diff --git a/src/pages/options/widgets/lbry.pug b/src/pages/options/widgets/lbry.pug deleted file mode 100644 index 9f01ebc6..00000000 --- a/src/pages/options/widgets/lbry.pug +++ /dev/null @@ -1,39 +0,0 @@ -section#lbry_page.option-block - .some-block.option-block - 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 - - .some-block.option-block - h4(data-localise="__MSG_redirectType__") Redirect Type - select#lbry-redirect_type - option(value="both" data-localise="__MSG_both__") both - option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded - option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded - - #librarian - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://librarian.com') - include ../../widgets/latency.pug - +latency('librarian') - .tor - include ../../widgets/instances.pug - +instances('https://librarian.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://librarian.onion') - .loki - include ../../widgets/instances.pug - +instances('http://librarian.loki') - - script(type="module" src="./widgets/lbry.js") diff --git a/src/pages/options/widgets/maps.pug b/src/pages/options/widgets/maps.pug deleted file mode 100644 index 66d0d411..00000000 --- a/src/pages/options/widgets/maps.pug +++ /dev/null @@ -1,32 +0,0 @@ -section#maps_page.option-block - .some-block.option-block - h1(data-localise="__MSG_maps__") Maps - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#maps-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#maps-frontend - option(value="osm") OpenStreetMap - option(value="facil") Facil Map - - #facil - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://facilmap.com') - include ../../widgets/latency.pug - +latency('facil') - .tor - +instances('http://facilmap.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://facilmap.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://facilmap.loki') - - script(type="module" src="./widgets/maps.js") diff --git a/src/pages/options/widgets/medium.pug b/src/pages/options/widgets/medium.pug deleted file mode 100644 index 60223fdf..00000000 --- a/src/pages/options/widgets/medium.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#medium_page.option-block - .some-block.option-block - h1(data-localise="__MSG_medium__") Medium - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#medium-enable(type="checkbox") - - #scribe - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://scribe.com') - include ../../widgets/latency.pug - +latency('scribe') - .tor - include ../../widgets/instances.pug - +instances('http://scribe.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://scribe.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://scribe.loki') - - script(type="module" src="./widgets/medium.js") diff --git a/src/pages/options/widgets/peertube.pug b/src/pages/options/widgets/peertube.pug deleted file mode 100644 index 2b818df4..00000000 --- a/src/pages/options/widgets/peertube.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#peertube_page.option-block - .some-block.option-block - h1(data-localise="__MSG_peertube__") PeerTube - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#peertube-enable(type="checkbox") - - #simpleertube - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://simpleertube.com') - include ../../widgets/latency.pug - +latency('simpleertube') - .tor - include ../../widgets/instances.pug - +instances('http://simpleertube.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://simpleertube.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://simpleertube.loki') - - script(type="module" src="./widgets/peertube.js") diff --git a/src/pages/options/widgets/quora.pug b/src/pages/options/widgets/quora.pug deleted file mode 100644 index 7c3c52ac..00000000 --- a/src/pages/options/widgets/quora.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#quora_page.option-block - .some-block.option-block - h1(data-localise="__MSG_quora__") Quora - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#quora-enable(type="checkbox") - - #quetre - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://quetre.com') - include ../../widgets/latency.pug - +latency('quetre') - .tor - include ../../widgets/instances.pug - +instances('http://quetre.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://quetre.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://quetre.loki') - - script(type="module" src="./widgets/quora.js") diff --git a/src/pages/options/widgets/reddit.pug b/src/pages/options/widgets/reddit.pug deleted file mode 100644 index 24c437f4..00000000 --- a/src/pages/options/widgets/reddit.pug +++ /dev/null @@ -1,48 +0,0 @@ -section#reddit_page.option-block - .some-block.option-block - h1(data-localise="__MSG_reddit__") Reddit - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#reddit-enable(type="checkbox") - - .some-block.option-block - h4#frontend(data-localise="__MSG_frontend__") Frontend - select#reddit-frontend - option(value="libreddit") Libreddit - option(value="teddit") Teddit - - #libreddit - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://libreddit.com') - include ../../widgets/latency.pug - +latency('libreddit') - .tor - include ../../widgets/instances.pug - +instances('http://libreddit.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://libreddit.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://libreddit.loki') - - #teddit - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://teddit.com') - +latency('teddit') - .tor - include ../../widgets/instances.pug - +instances('http://teddit.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://teddit.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://teddit.loki') - - script(type="module" src="./widgets/reddit.js") diff --git a/src/pages/options/widgets/reuters.pug b/src/pages/options/widgets/reuters.pug deleted file mode 100644 index 985965a1..00000000 --- a/src/pages/options/widgets/reuters.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#reuters_page.option-block - .some-block.option-block - h1(data-localise="__MSG_reuters__") Reuters - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#reuters-enable(type="checkbox") - - #neuters - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://neuters.com') - include ../../widgets/latency.pug - +latency('neuters') - .tor - include ../../widgets/instances.pug - +instances('http://neuters.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://neuters.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://neuters.loki') - - script(type="module" src="./widgets/reuters.js") diff --git a/src/pages/options/widgets/search.pug b/src/pages/options/widgets/search.pug deleted file mode 100644 index f449e0db..00000000 --- a/src/pages/options/widgets/search.pug +++ /dev/null @@ -1,85 +0,0 @@ -section#search_page.option-block - .some-block.option-block - h1(data-localise="__MSG_search__") Search - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#search-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#search-frontend - option(value="searxng") SearXNG - option(value="searx") SearX - option(value="whoogle") Whoogle - option(value="librex") LibreX - - .some-block - h4(data-localise="__MSG_searchNote__") Note: To use Search, make LibRedirect the Default Search Engine - - #searx - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://searx.com') - include ../../widgets/latency.pug - +latency('searx') - .tor - include ../../widgets/instances.pug - +instances('http://searx.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://searx.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://searx.loki') - - #searxng - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://searxng.com') - +latency('searxng') - .tor - include ../../widgets/instances.pug - +instances('http://searxng.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://searxng.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://searxng.loki') - - #whoogle - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://whoogle.com') - +latency('whoogle') - .tor - include ../../widgets/instances.pug - +instances('http://whoogle.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://whoogle.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://whoogle.loki') - - #librex - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://librex.com') - +latency('librex') - .tor - include ../../widgets/instances.pug - +instances('http://librex.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://librex.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://librex.loki') - - script(type="module" src="./widgets/search.js") diff --git a/src/pages/options/widgets/sendTargets.pug b/src/pages/options/widgets/sendTargets.pug deleted file mode 100644 index e7676b37..00000000 --- a/src/pages/options/widgets/sendTargets.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#sendTargets_page.option-block - .some-block.option-block - h1(data-localise="__MSG_sendFiles__") Send Files - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#sendTargets-enable(type="checkbox") - - #send - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://send.com') - include ../../widgets/latency.pug - +latency('send') - .tor - include ../../widgets/instances.pug - +instances('http://send.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://send.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://send.loki') - - script(type="module" src="./widgets/sendTargets.js") diff --git a/src/pages/options/widgets/services.ejs b/src/pages/options/widgets/services.ejs index a1b0a538..aed5872b 100644 --- a/src/pages/options/widgets/services.ejs +++ b/src/pages/options/widgets/services.ejs @@ -1,5 +1,5 @@ -<% config.services.forEach(service=>{ %> -
+<% for (const service in config.services) { %> +

<%= config.services[service].name %>

@@ -8,33 +8,35 @@

Enable

+ <% if ((Object.keys(config.services[service].frontends).length > 1) || config.services[service].singleInstanceFrontends) { %>

Frontend

- <% if (config.services[service].embeddable) { %> - <% if (config.services[service].singleInstanceFrontends) { %> + <% } %> + <% if ((config.services[service].singleInstanceFrontends) && (Object.keys(config.services[service].frontends).length > 1)) { %>
-

Embedded Videos Frontend

+

Embed Frontend

<% } %> + <% if (config.services[service].embeddable) { %>

Redirect Type

- @@ -42,9 +44,9 @@
<% } %>
- <% config.services[service].frontends.forEach(frontend=>{ %> + <% for (const frontend in config.services[service].frontends) { %>
- <% config.networks.forEach(network=>{ %> + <% for (const network in config.networks) { %>

Default Instances

@@ -56,7 +58,7 @@
- +
<% } %>
- <% }); %> - <% }); %> + <% }; %> +
+ <% }; %>
-<% }); %> +<% }; %> diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index 5f370a18..c7955b40 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -12,7 +12,8 @@ async function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - config = JSON.parse(data) + const tmp = JSON.parse(data) + config = tmp.config resolve() }) }) diff --git a/src/pages/options/widgets/tiktok.pug b/src/pages/options/widgets/tiktok.pug deleted file mode 100644 index 986bd270..00000000 --- a/src/pages/options/widgets/tiktok.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#tiktok_page.option-block - .some-block.option-block - h1(data-localise="__MSG_tiktok__") TikTok - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#tiktok-enable(type="checkbox") - - #proxiTok - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://proxitok.com') - include ../../widgets/latency.pug - +latency('proxiTok') - .tor - include ../../widgets/instances.pug - +instances('http://proxitok.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://proxitok.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://proxitok.loki') - - script(type="module" src="./widgets/tiktok.js") diff --git a/src/pages/options/widgets/translate.pug b/src/pages/options/widgets/translate.pug deleted file mode 100644 index 40d42bca..00000000 --- a/src/pages/options/widgets/translate.pug +++ /dev/null @@ -1,48 +0,0 @@ -section#translate_page.option-block - .some-block.option-block - h1(data-localise="__MSG_translate__") Translate - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#translate-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#translate-frontend - option(value="simplyTranslate") SimplyTranslate - option(value="lingva") Lingva - - hr - #simplyTranslate - .clearnet - include ../../widgets/instances.pug - +instances('https://simplytranslate.org') - include ../../widgets/latency.pug - +latency('simplyTranslate') - .tor - include ../../widgets/instances.pug - +instances('http://hxecvvetgrznmprg.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://simplytranslate.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://simplytranslate.loki') - - #lingva - .clearnet - include ../../widgets/instances.pug - +instances('https://lingvatranslate.com') - +latency('lingva') - .tor - include ../../widgets/instances.pug - +instances('http://lingvatranslate.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://lingvatranslate.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://lingvatranslate.loki') - - - script(type="module" src="./widgets/translate.js") diff --git a/src/pages/options/widgets/twitter.pug b/src/pages/options/widgets/twitter.pug deleted file mode 100644 index fa7f1320..00000000 --- a/src/pages/options/widgets/twitter.pug +++ /dev/null @@ -1,33 +0,0 @@ -section#twitter_page.option-block - .some-block.option-block - h1(data-localise="__MSG_twitter__") Twitter - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#twitter-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_redirectType__") Redirect Type - select#twitter-redirect_type - option(value="both" data-localise="__MSG_both__") both - option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded - option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded - - #nitter - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://nitter.com') - include ../../widgets/latency.pug - +latency('nitter') - .tor - include ../../widgets/instances.pug - +instances('http://nitter.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://nitter.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://nitter.loki') - - script(type="module" src="./widgets/twitter.js") diff --git a/src/pages/options/widgets/wikipedia.pug b/src/pages/options/widgets/wikipedia.pug deleted file mode 100644 index a0ad37c3..00000000 --- a/src/pages/options/widgets/wikipedia.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#wikipedia_page.option-block - .some-block.option-block - h1(data-localise="__MSG_wikipedia__") Wikipedia - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#wikipedia-enable(type="checkbox") - - #wikiless - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://wikiless.com') - include ../../widgets/latency.pug - +latency('wikiless') - .tor - include ../../widgets/instances.pug - +instances('http://wikiless.onion') - .i2p - include ../../widgets/instances.pug - +instances('https://wikiless.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://wikiless.loki') - - script(type="module" src="./widgets/wikipedia.js") diff --git a/src/pages/options/widgets/youtube.pug b/src/pages/options/widgets/youtube.pug deleted file mode 100644 index cf48d9be..00000000 --- a/src/pages/options/widgets/youtube.pug +++ /dev/null @@ -1,103 +0,0 @@ -section#youtube_page.option-block - .some-block.option-block - h1(data-localise="__MSG_youtube__") YouTube - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#youtube-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#youtube-frontend - option(value="invidious") Invidious - option(value="piped") Piped - option(value="pipedMaterial") Piped-Material - option(value="cloudtube") CloudTube - option(value="freetube") FreeTube - option(value="yatte") Yattee - - #youtube-embedded_frontend - .some-block.option-block - h4(data-localise="__MSG_embeddedVids__") Embedded Videos Frontend - select#youtube-embed_frontend - option(value="invidious") Invidious - option(value="piped") Piped - option(value="pipedMaterial") Piped-Material - option(value="cloudtube") CloudTube - - .some-block.option-block - h4(data-localise="__MSG_redirectType__") Redirect Type - select#youtube-redirect_type - option(value="both" data-localise="__MSG_both__") both - option(value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__") Only Embedded - option(value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded - - #invidious - hr - .clearnet - include ../../widgets/instances.pug - +instances('http://invidious.com') - include ../../widgets/latency.pug - +latency('invidious') - .tor - include ../../widgets/instances.pug - +instances('http://invidious.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://invidious.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://invidious.loki') - - #piped - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://piped.com') - include ../../widgets/latency.pug - +latency('piped') - .tor - +instances('http://piped.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://piped.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://piped.loki') - - #pipedMaterial - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://piped-material.com') - include ../../widgets/latency.pug - +latency('pipedMaterial') - .tor - +instances('http://piped-material.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://piped-material.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://piped-material.loki') - - #cloudtube - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://cloudtube.com') - include ../../widgets/latency.pug - +latency('cloudtube') - .tor - +instances('http://cloudtube.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://cloudtube.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://cloudtube.loki') - - script(type="module" src="./widgets/youtube.js") diff --git a/src/pages/options/widgets/youtubeMusic.pug b/src/pages/options/widgets/youtubeMusic.pug deleted file mode 100644 index 9c2c08cf..00000000 --- a/src/pages/options/widgets/youtubeMusic.pug +++ /dev/null @@ -1,49 +0,0 @@ -section#youtubeMusic_page.option-block - .some-block.option-block - h1(data-localise="__MSG_ytmusic__") YouTube Music - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#youtubeMusic-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#youtubeMusic-frontend - option(value="beatbump") Beatbump - option(value="hyperpipe") Hyperpipe - - #beatbump - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://beatbump.org') - include ../../widgets/latency.pug - +latency('beatbump') - .tor - +instances('http://beatbump.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://beatbump.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://beatbump.loki') - - #hyperpipe - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://hyperpipe.org') - include ../../widgets/latency.pug - +latency('hyperpipe') - .tor - +instances('http://hyperpipe.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://hyperpipe.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://hyperpipe.loki') - - script(type="module" src="./widgets/youtubeMusic.js") diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index eacfe91b..fe0cd37c 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -1,7 +1,7 @@ -- cgit 1.4.1 From a72a32612032280fb994c7f4495ca153123ac5c7 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sun, 18 Sep 2022 17:13:07 +0100 Subject: Rollback master to pre-OOP --- .woodpecker/instances.yml | 23 +++++++++++++++++++++++ README.md | 2 +- src/instances/beatbump.json | 7 ++----- src/instances/bibliogram.json | 6 ++++++ src/instances/get_instances.py | 13 +++---------- 5 files changed, 35 insertions(+), 16 deletions(-) create mode 100644 .woodpecker/instances.yml create mode 100644 src/instances/bibliogram.json diff --git a/.woodpecker/instances.yml b/.woodpecker/instances.yml new file mode 100644 index 00000000..96fe59f6 --- /dev/null +++ b/.woodpecker/instances.yml @@ -0,0 +1,23 @@ +pipeline: + instancefetch: + image: python:3.8 + secrets: [token, mail] + when: + event: cron + commands: + - python -m pip install --upgrade pip + - pip install requests bs4 colorama + - python src/instances/get_instances.py + # Git configuration + - git config --global user.email $MAIL + - git config --global user.name "Woodpecker CI" + - git commit -am "updated instances" + - mkdir ~/.ssh + - ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts + - git remote set-url origin git@codeberg.org:libredirect/libredirect.git + #- echo $TOKEN > key + #- chmod 0600 key + - eval `ssh-agent` + - echo "$TOKEN" | tr -d '\r' | ssh-add - + #- ssh-add key + - git push --set-upstream origin master diff --git a/README.md b/README.md index db740eb0..c97a20ff 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Send Files => [Send](https://gitlab.com/timvisee/send) **Note**: The Extension will be using random instances by default. You can modify this and add custom instances too. -[FAQ](https://libredirect.github.io/faq.html) +# Please read the [FAQ](https://libredirect.github.io/faq.html) if you have any questions! ## Donate diff --git a/src/instances/beatbump.json b/src/instances/beatbump.json index df5a20f7..e09273dd 100644 --- a/src/instances/beatbump.json +++ b/src/instances/beatbump.json @@ -1,9 +1,6 @@ { - "normal": [ - "https://beatbump.ml", - "https://beatbump.esmailelbob.xyz" - ], - "tor": [], + "normal": ["https://beatbump.ml", "https://beatbump.esmailelbob.xyz"], + "tor": ["http://beatbump.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion"], "i2p": [], "loki": [] } diff --git a/src/instances/bibliogram.json b/src/instances/bibliogram.json new file mode 100644 index 00000000..d72f2129 --- /dev/null +++ b/src/instances/bibliogram.json @@ -0,0 +1,6 @@ +{ + "normal": ["https://bibliogram.1d4.us", "https://bibliogram.froth.zone", "https://ig.tokhmi.xyz", "https://ig.beparanoid.de", "https://bibliogram.priv.pw"], + "tor": [], + "i2p": [], + "loki": [] +} diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 085d7273..250dd258 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -230,16 +230,9 @@ def nitter(): def bibliogram(): - r = requests.get('https://bibliogram.art/api/instances') - rJson = json.loads(r.text) - bibliogramList = {} - bibliogramList['normal'] = [] - bibliogramList['tor'] = [] - bibliogramList['i2p'] = [] - bibliogramList['loki'] = [] - for item in rJson['data']: - bibliogramList['normal'].append(item['address']) - mightyList['bibliogram'] = bibliogramList + json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) + with open('./src/instances/bibliogram.json') as file: + mightyList['bibliogram'] = json.load(file) print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Bibliogram') -- cgit 1.4.1 From b6067a04e2c2a9e17b2ff9954880868d2890d52c Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 19 Sep 2022 00:06:41 +0200 Subject: Remove dead instances. --- src/instances/cloudtube.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/instances/cloudtube.json b/src/instances/cloudtube.json index 402adc39..2c55b083 100644 --- a/src/instances/cloudtube.json +++ b/src/instances/cloudtube.json @@ -1,6 +1,6 @@ { - "normal": ["https://tube.cadence.moe", "https://yt.beparanoid.de"], - "tor": ["http://yt.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion"], + "normal": ["https://tube.cadence.moe"], + "tor": [], "i2p": [], "loki": [] } -- cgit 1.4.1 From 3619bd96364ad04d7fcc6b948253e9b385de90c5 Mon Sep 17 00:00:00 2001 From: Woodpecker CI Date: Mon, 19 Sep 2022 00:08:42 +0000 Subject: updated instances --- src/instances/blacklist.json | 59 +++++---- src/instances/data.json | 301 +++++++++++++++++++++---------------------- 2 files changed, 181 insertions(+), 179 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 0c9a8502..9df5b306 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -1,13 +1,16 @@ { "cloudflare": [ "https://invidious.kavin.rocks", + "https://invidious.rhyshl.live", "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", - "https://us-piped.shimul.me", + "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://watch.whatever.social", + "https://piped.garudalinux.org", + "https://y.rivo.lol", "https://cringe.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", @@ -17,10 +20,14 @@ "https://twtr.bch.bar", "https://twitter.dr460nf1r3.org", "https://nitter.garudalinux.org", - "https://nitter.wef.lol", "https://nitter.catalyst.sx", "https://nitter.fprivacy.com", - "https://bib.actionsack.com", + "https://read.whatever.social", + "https://nitter.rawbit.ninja", + "https://nitter.privacytools.io", + "https://nitter.sneed.network", + "https://n.sneed.network", + "https://nitter.twei.space", "https://libreddit.domain.glass", "https://r.nf", "https://libreddit.hu", @@ -39,12 +46,14 @@ "https://teddit.garudalinux.org", "https://tedd.it", "https://wiki.privacytools.io", - "https://wiki.604kph.xyz", + "https://teddit.rawbit.ninja", "https://wiki.privacytools.io", + "https://wikiless.rawbit.ninja", + "https://scribe.rawbit.ninja", "https://lingva.garudalinux.org", "https://translate.dr460nf1r3.org", - "https://searx.org", "https://searx.run", + "https://searx.org", "https://search.garudalinux.org", "https://search.dr460nf1r3.org", "https://search.wef.lol", @@ -57,34 +66,34 @@ "https://nitter:nitter@nitter.nixnet.services" ], "offline": [ - "https://invidious.kavin.rocks", - "https://invidious.osi.kr", - "https://tok.habedieeh.re", - "https://twitter.dr460nf1r3.org", - "https://nitter.catalyst.sx", - "https://twt.funami.tech", - "https://bibliogram.snopyta.org", - "https://ig.beparanoid.de", - "https://libreddit.autarkic.org", - "https://reddi.tk", + "https://invidious.rhyshl.live", + "https://invidious.esmailelbob.xyz", + "https://proxitok.odyssey346.dev", + "https://nhanh.cloud", + "https://nitter.winscloud.net", + "https://ntr.odyssey346.dev", + "https://r.walkx.org", + "https://libreddit.winscloud.net", "https://libreddit.notyourcomputer.net", - "https://reddit.dr460nf1r3.org", - "https://translate.riverside.rocks", - "https://translate.dr460nf1r3.org", - "https://anon.sx", + "https://teddit.ggc-project.de", + "https://teddit.nautolan.racing", + "https://tedd.it", + "https://wiki.froth.zone", + "https://quetre.odyssey346.dev", + "https://translate.northboot.xyz", + "https://st.odyssey346.dev", "https://jsearch.pw", "https://searx.gnu.style", "https://searx.semipvt.com", "https://etsi.me", - "https://s.zhaocloud.net", - "https://search.vidhukant.xyz", + "https://search.zzls.xyz", "https://searx.ericaftereric.top", "https://searx.fmac.xyz", - "https://searxng.au/searx", "https://www.webrats.xyz", - "https://search.dr460nf1r3.org", "https://whoogle.esmailelbob.xyz", - "https://beatbump.ml", - "https://stube.tokhmi.xyz" + "https://search.wef.lol", + "https://i.bcow.xyz", + "https://lbry.bcow.xyz", + "https://beatbump.ml" ] } \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index eb987ff1..e9533bfe 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -4,35 +4,37 @@ "https://yewtu.be", "https://vid.puffyan.us", "https://invidious.snopyta.org", + "https://invidious.kavin.rocks", "https://inv.riverside.rocks", + "https://invidio.xamh.de", "https://y.com.sb", "https://yt.artemislena.eu", - "https://invidious.flokinet.to", "https://invidious.sethforprivacy.com", + "https://invidious.flokinet.to", "https://invidious.tiekoetter.com", "https://inv.bp.projectsegfau.lt", - "https://invidious.projectsegfau.lt", "https://inv.vern.cc", + "https://invidious.projectsegfau.lt", "https://invidious.nerdvpn.de", + "https://invidious.rhyshl.live", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://youtube.076.ne.jp", "https://invidious.weblibre.org", - "https://invidious.kavin.rocks", - "https://invidious.namazso.eu", "https://invidious.esmailelbob.xyz", - "https://invidious.osi.kr" + "https://youtube.076.ne.jp", + "https://invidious.namazso.eu" ], "tor": [ - "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", - "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", - "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", - "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", - "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", - "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", - "http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion", + "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://invidious.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion", + "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", + "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", + "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", + "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", + "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", + "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", + "http://am74vkcrjp2d5v36lcdqgsj2m6x36tbrkhsruoegwfcizzabnfgf5zyd.onion" ], "i2p": [], "loki": [] @@ -43,14 +45,21 @@ "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", - "https://us-piped.shimul.me", + "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://watch.whatever.social", + "https://piped.garudalinux.org", + "https://y.rivo.lol", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://il.ax", "https://piped.privacy.com.de", - "https://piped.esmailelbob.xyz" + "https://piped.projectsegfau.lt", + "https://piped.privacydev.net", + "https://piped.palveluntarjoaja.eu", + "https://piped.smnz.de", + "https://piped.adminforge.de", + "https://watch.whatevertinfoil.de" ], "tor": [], "i2p": [], @@ -61,7 +70,8 @@ "https://piped-material.১.net", "https://piped-material.ftp.sh", "https://piped-staging.ftp.sh", - "https://ui.piped.১.net" + "https://ui.piped.১.net", + "https://ng.piped.১.net" ], "tor": [], "i2p": [], @@ -69,23 +79,25 @@ }, "cloudtube": { "normal": [ - "https://tube.cadence.moe", - "https://yt.beparanoid.de" - ], - "tor": [ - "http://yt.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion" + "https://tube.cadence.moe" ], + "tor": [], "i2p": [], "loki": [] }, "proxiTok": { "normal": [ - "https://proxitok.herokuapp.com", + "https://proxitok.pabloferreiro.es", "https://proxitok.pussthecat.org", "https://tok.habedieeh.re", "https://proxitok.esmailelbob.xyz", "https://cringe.whatever.social", - "https://proxitok.dhusch.de" + "https://proxitok.dhusch.de", + "https://proxitok.privacydev.net", + "https://proxitok.odyssey346.dev", + "https://tok.artemislena.eu", + "https://tok.adminforge.de", + "https://proxitok.manasiwibi.com" ], "tor": [], "i2p": [], @@ -148,13 +160,11 @@ "https://fuckthesacklers.network", "https://nitter.esmailelbob.xyz", "https://tw.artemislena.eu", - "https://de.nttr.stream", "https://nitter.winscloud.net", "https://nitter.tiekoetter.com", "https://nitter.spaceint.fr", "https://twtr.bch.bar", "https://nitter.privacy.com.de", - "https://nitter.notraxx.ch", "https://nitter.poast.org", "https://nitter.bird.froth.zone", "https://nitter.dcs0.hu", @@ -164,12 +174,11 @@ "https://n.ramle.be", "https://nitter.cz", "https://nitter.privacydev.net", + "https://nitter.evil.site", "https://tweet.lambda.dance", - "https://nitter.ebnar.xyz", "https://nitter.kylrth.com", "https://nitter.foss.wtf", "https://nitter.priv.pw", - "https://nitter.wef.lol", "https://nitter.tokhmi.xyz", "https://nitter.catalyst.sx", "https://unofficialbird.com", @@ -183,7 +192,20 @@ "https://uk.unofficialbird.com", "https://n.l5.ca", "https://nitter.slipfox.xyz", - "https://nitter.soopy.moe" + "https://nitter.soopy.moe", + "https://nitter.qwik.space", + "https://read.whatever.social", + "https://nitter.rawbit.ninja", + "https://nt.vern.cc", + "https://ntr.odyssey346.dev", + "https://nitter.ir", + "https://nitter.privacytools.io", + "https://nitter.sneed.network", + "https://n.sneed.network", + "https://nitter.manasiwibi.com", + "https://nitter.smnz.de", + "https://nitter.twei.space", + "https://nitter.inpt.fr" ], "tor": [ "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -196,7 +218,7 @@ "http://jebqj47jgxleaiosfcxfibx2xdahjettuydlxbg64azd4khsxv6kawid.onion", "http://nttr2iupbb6fazdpr2rgbooon2tzbbsvvkagkgkwohhodjzj43stxhad.onion", "http://nitraeju2mipeziu2wtcrqsxg7h62v5y4eqgwi75uprynkj74gevvuqd.onion", - "http://nitter.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://nitter.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://ibsboeui2im5o7dxnik3s5yghufumgy5abevtij5nbizequfpu4qi4ad.onion", "http://ec5nvbycpfa5k6ro77blxgkyrzbkv7uy6r5cngcbkadtjj2733nm3uyd.onion", "http://twitter.ap3jtgssd7qn4vfoa62gi2ijddoblslbeuw5dan3xt7myvqpura5i4qd.onion", @@ -206,12 +228,17 @@ "http://nitterqdyumlovt7tjqpdjrluitgmtpa53qq3idlpgoe4kxo7gs3xvad.onion", "http://nitter.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion", - "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion" + "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion", + "http://qwikxx2erhx6qrymued6ox2qkf2yeogjwypqvzoif4fqkljixasr6oid.onion", + "http://4g47cxugkohbweao2x66nnxxfoe3k7gdfzxej537nhdbwr522sbjxeqd.onion", + "http://tw.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion" ], "i2p": [ "http://axd6uavsstsrvstva4mzlzh4ct76rc6zdug3nxdgeitrzczhzf4q.b32.i2p", "http://u6ikd6zndl3c4dsdq4mmujpntgeevdk5qzkfb57r4tnfeccrn2qa.b32.i2p", - "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p" + "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p", + "http://tm4rwkeysv3zz3q5yacyr4rlmca2c4etkdobfvuqzt6vsfsu4weq.b32.i2p", + "http://vernzdedoxuflrrxc4vbatbkpjh4k22ecgiqgimdiif62onhagva.b32.i2p" ], "loki": [ "http://nitter.priv.loki" @@ -219,18 +246,11 @@ }, "bibliogram": { "normal": [ - "https://bibliogram.art", - "https://bibliogram.snopyta.org", - "https://bibliogram.pussthecat.org", "https://bibliogram.1d4.us", "https://bibliogram.froth.zone", - "https://insta.trom.tf", - "https://insta.tromdienste.de", "https://ig.tokhmi.xyz", "https://ig.beparanoid.de", - "https://bibliogram.priv.pw", - "https://ig.funami.tech", - "https://bib.actionsack.com" + "https://bibliogram.priv.pw" ], "tor": [], "i2p": [], @@ -346,14 +366,23 @@ "https://teddit.tokhmi.xyz", "https://teddit.garudalinux.org", "https://tedd.it", - "https://wiki.privacytools.io" + "https://wiki.privacytools.io", + "https://td.vern.cc", + "https://teddit.rawbit.ninja", + "https://teddit.artemislena.eu", + "https://teddit.manasiwibi.com" ], "tor": [ "http://snoo.ioensistjs7wd746zluwixvojbbkxhr37lepdvwtdfeav673o64iflqd.onion", "http://ibarajztopxnuhabfu7fg6gbudynxofbnmvis3ltj6lfx47b6fhrd5qd.onion", "http://tedditfyn6idalzso5wam5qd3kdtxoljjhbrbbx34q2xkcisvshuytad.onion", "http://dawtyi5e2cfyfmoht4izmczi42aa2zwh6wi34zwvc6rzf2acpxhrcrad.onion", - "http://qtpvyiaqhmwccxwzsqubd23xhmmrt75tdyw35kp43w4hvamsgl3x27ad.onion" + "http://qtpvyiaqhmwccxwzsqubd23xhmmrt75tdyw35kp43w4hvamsgl3x27ad.onion", + "http://jnuonmf2n36sfdmyksqqqyab3w63cq4kx24olyjleh5z6zzfvyt7uqqd.onion", + "http://td.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://yqu4yj5lju7bmlwpzpmltb5gsu6cw7nnbcxxx4iqemwa56nxjiggf4qd.onion", + "http://teddit.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion", + "http://24fympskbrdgbf4afuvhqwwl2tv3y2vwxg5t2ktozd4j5b3fob5ntzyd.onion" ], "i2p": [], "loki": [] @@ -371,14 +400,17 @@ "https://wiki.slipfox.xyz", "https://wikiless.funami.tech", "https://wl.vern.cc", - "https://wiki.privacytools.io" + "https://wiki.privacytools.io", + "https://wikiless.rawbit.ninja", + "https://wiki.adminforge.de" ], "tor": [ "http://dj2tbh2nqfxyfmvq33cjmhuw7nb6am7thzd3zsjvizeqf374fixbrxyd.onion", "http://ybgg2evrcdz37y2qes23ff3wjqjdn33tthgoagi76vhxytu4mpxiz5qd.onion", - "http://wikiless.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://wikiless.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion", - "http://wl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://wl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://tdx37ew3oke5rxn3yi5r5665ka7ozvehnd4xmnjxxdvqorias2nyl4qd.onion" ], "i2p": [ "http://wikiless.i2p", @@ -395,7 +427,10 @@ "https://scribe.citizen4.eu", "https://scribe.bus-hit.me", "https://scribe.froth.zone", - "https://scribe.esmailelbob.xyz" + "https://scribe.esmailelbob.xyz", + "https://scribe.privacydev.net", + "https://scribe.rawbit.ninja", + "https://sc.vern.cc" ], "tor": [], "i2p": [], @@ -403,17 +438,19 @@ }, "quetre": { "normal": [ - "https://quetre.herokuapp.com", - "https://quora.vern.cc", + "https://quetre.iket.me", + "https://qr.vern.cc", "https://quetre.pussthecat.org", "https://wuetre.herokuapp.com", "https://quetreus.herokuapp.com", "https://quetre.tokhmi.xyz", "https://quetre.projectsegfau.lt", - "https://quetre.esmailelbob.xyz" + "https://quetre.esmailelbob.xyz", + "https://quetre.odyssey346.dev" ], "tor": [ - "http://quetre.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + "http://quetre.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", + "http://qr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" ], "i2p": [], "loki": [] @@ -439,7 +476,7 @@ "https://translate.josias.dev", "https://translate.namazso.eu", "https://translate.riverside.rocks", - "https://st.manerakai.com", + "https://simplytranslate.manerakai.com", "https://translate.bus-hit.me", "https://simplytranslate.pussthecat.org", "https://translate.northboot.xyz", @@ -449,16 +486,19 @@ "https://translate.slipfox.xyz", "https://st.privacydev.net", "https://translate.beparanoid.de", - "https://translate.priv.pw" + "https://translate.priv.pw", + "https://st.odyssey346.dev" ], "tor": [ "http://fyng2tsmzmvxmojzbbwmfnsn2lrcyftf4cw6rk5j2v2huliazud3fjid.onion", "http://xxtbwyb5z5bdvy2f6l2yquu5qilgkjeewno4qfknvb3lkg3nmoklitid.onion", "http://translate.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", - "http://simplytranslate.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + "http://simplytranslate.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", + "http://tl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" ], "i2p": [ - "http://kmnkkp4v4ublygtnyq46oacy3qw75nrxxniriuaersumw7bfsm2a.b32.i2p" + "http://kmnkkp4v4ublygtnyq46oacy3qw75nrxxniriuaersumw7bfsm2a.b32.i2p", + "http://verna7avzgd4qqal7k2onjzwxcceqby2gwvya2a2frdswb7z2k4q.b32.i2p" ], "loki": [ "http://translate.priv.loki" @@ -482,7 +522,6 @@ }, "searx": { "normal": [ - "https://anon.sx", "https://dynabyte.ca", "https://jsearch.pw", "https://search.ethibox.fr", @@ -499,7 +538,6 @@ "https://searx.nakhan.net", "https://searx.netzspielplatz.de", "https://searx.nixnet.services", - "https://searx.org", "https://searx.ru", "https://searx.run", "https://searx.semipvt.com", @@ -522,11 +560,11 @@ ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion" ], "i2p": [ "http://ransack.i2p", @@ -539,8 +577,11 @@ "https://darmarit.org/searx", "https://de.xcxc.ml", "https://etsi.me", + "https://icanfindit.online", "https://jackgoss.xyz", + "https://metasearch.nl", "https://northboot.xyz", + "https://notsearch.uk", "https://opnxng.com", "https://paulgo.io", "https://priv.au", @@ -552,18 +593,25 @@ "https://search.affusio.com", "https://search.bus-hit.me", "https://search.chemicals-in-the-water.eu", + "https://search.cronobox.one", "https://search.disroot.org", "https://search.gcomm.ch", "https://search.kiwitalk.de", "https://search.mdosch.de", + "https://search.mpx.wtf", "https://search.neet.works", "https://search.ononoki.org", "https://search.privacyguides.net", "https://search.projectsegfau.lt", "https://search.rabbit-company.com", + "https://search.rhscze.cf", + "https://search.rowie.at", "https://search.sapti.me", + "https://search.serginho.dev", + "https://search.smnz.de", "https://search.teamriverbubbles.com", "https://search.unlocked.link", + "https://search.uspersec.com", "https://search.vidhukant.xyz", "https://search.zzls.xyz", "https://searx.baczek.me", @@ -580,6 +628,7 @@ "https://searx.mha.fi", "https://searx.mistli.net", "https://searx.namejeff.xyz", + "https://searx.org", "https://searx.orion-hub.fr", "https://searx.priv.pw", "https://searx.prvcy.eu", @@ -588,36 +637,35 @@ "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", - "https://searx.vimproved.me", "https://searx.zcyph.cc", - "https://searxng.au/searx", - "https://searxng.tordenskjold.de", + "https://searxng.nicfab.it", "https://searxng.zackptg5.com", - "https://searxvm.com", "https://serx.ml", "https://sh0.it", "https://soek.allesbeste.com", "https://srx.cosmohub.io", "https://swag.pw", + "https://trydex.tk/searxng", "https://www.gruble.de", - "https://www.higgssearch.com", "https://www.webrats.xyz", - "https://xcxc.ml", "https://xo.wtf" ], "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://privateoz3u5utrimal2edr56j3r5caakektxxgixigdkycuxigvquid.onion", "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", - "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", + "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", + "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", - "http://searx.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", - "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" + "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion", + "http://lgmekfnpealdqhnctyg3p5fuelpdwnbqbwnl2ickpdoodzatzgz27ryd.onion" ], "i2p": [], "loki": [] @@ -648,15 +696,16 @@ "https://librex.extravi.dev", "https://search.davidovski.xyz", "https://search.funami.tech", - "https://librex.catalyst.sx" + "https://librex.catalyst.sx", + "https://search.madreyk.xyz", + "https://search.pabloferreiro.es" ], "tor": [ - "http://librex.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", + "http://librex.2356uhnbpv5nk3bni5bv6jg2cd6lgj664kwx3lhyelstpttpyv4kk2qd.onion", "http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion", "http://librex.so2mpiyfo4cje7bof5v52y3cvjyo2haxpqfvut4sr6gj2ul4mddx2jid.onion" ], "i2p": [ - "http://ljluyti43556bflsucfkhegelemo6guchmq4g7ebxuentomupxoa.b32.i2p", "http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p" ], "loki": [] @@ -668,7 +717,6 @@ "https://rimgo.totaldarkness.net", "https://rimgo.bus-hit.me", "https://rimgo.esmailelbob.xyz", - "https://rimgo.lunar.icu", "https://i.actionsack.com", "https://rimgo.privacydev.net", "https://imgur.artemislena.eu", @@ -677,7 +725,7 @@ "https://rimgo.mha.fi" ], "tor": [ - "http://rimgo.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://rimgo.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://rimgo.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], @@ -692,12 +740,17 @@ "https://lbry.projectsegfau.lt", "https://librarian.esmailelbob.xyz", "https://lbry.vern.cc", - "https://lbry.slipfox.xyz" + "https://lbry.slipfox.xyz", + "https://lbry.sytes.net", + "https://lbry.webhop.me", + "https://lbry.mywire.org" ], "tor": [ - "http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://librarian.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", - "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion" + "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion", + "http://zjmls4urccc5wxc64ilbv4oqarjab6pbanvmhd2qqt6p7fgqrjjnryqd.onion", + "http://bxewpsswttslepw27w2hhxhlizwm7l7y54x3jw5cfrb64hb6lgc557ad.onion" ], "i2p": [], "loki": [] @@ -715,7 +768,9 @@ "https://beatbump.ml", "https://beatbump.esmailelbob.xyz" ], - "tor": [], + "tor": [ + "http://beatbump.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion" + ], "i2p": [], "loki": [] }, @@ -726,7 +781,7 @@ "https://listen.whatever.social" ], "tor": [ - "http://hyperpipe.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + "http://hyperpipe.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion" ], "i2p": [], "loki": [] @@ -743,14 +798,27 @@ "normal": [ "https://tube.simple-web.org", "https://simpleertube.esmailelbob.xyz", - "https://stube.tokhmi.xyz" + "https://stube.tokhmi.xyz", + "https://st.vern.cc" ], "tor": [], "i2p": [], "loki": [] }, "peertube": [ - "https://jzqk.org", + "https://peertube.tni-hosted.nl", + "https://videos.parleur.net", + "https://tube.azadehafzar.ir", + "https://pewflix.com", + "https://video.electronicping.net", + "https://videos.im.allmendenetz.de", + "https://tube.cyberia.club", + "https://casstream.nohost.me", + "https://peertube.as62430.net", + "https://peertube.askan.info", + "https://apertatube.net", + "https://beetoons.tv", + "https://rankett.net", "https://tube.xsoftware.it", "https://video.ut0pia.org", "https://kinotu.be", @@ -758,23 +826,17 @@ "https://www.neptube.io", "https://tube.ghk-academy.info", "https://pcbu.nl", - "https://soberania.tv", "https://pire.artisanlogiciel.net", "https://tube-test.apps.education.fr", "https://tube-sciences-technologies.apps.education.fr", - "https://stream.conesphere.cloud", "https://tube-institutionnel.apps.education.fr", "https://trutube.online", "https://tube-cycle-3.apps.education.fr", "https://video.manicphase.me", "https://tube.emy.plus", "https://tubulus.openlatin.org", - "https://peertube.securetown.top", - "https://tv.datamol.org", "https://video.graine-pdl.org", "https://tube-cycle-2.apps.education.fr", - "https://mikeclips.net", - "https://tube.s1gm4.eu", "https://videos.keyedlimepie.org", "https://video.davduf.net", "https://tube.oldkid.digital", @@ -786,8 +848,6 @@ "https://media.theplattform.net", "https://peertube.offerman.com", "https://v.lastorder.xyz", - "https://peertube.thele.me", - "https://video.schnitzler.one", "https://tube.cybershock.life", "https://tube.reseau-canope.fr", "https://frentube.myyouniverse.observer", @@ -797,15 +857,12 @@ "https://video.trankil.info", "https://video.uriopss-pdl.fr", "https://pt.bolapara.mywire.org", - "https://ptube.ranranhome.info", "https://video.3cmr.fr", - "https://tube.die-rote-front.de", "https://peertube.miguelcr.me", "https://video.thinkof.name", "https://nekofans.tv", "https://video.comun.al", "https://video.occm.cc", - "https://peertube.viviers-fibre.net", "https://tube-action-educative.apps.education.fr", "https://jahve.pl", "https://videos.yesil.club", @@ -820,49 +877,38 @@ "https://t.0x0.st", "https://tube-education-physique-et-sportive.apps.education.fr", "https://videos.lemouvementassociatif-pdl.org", - "https://videos.casually.cat", "https://playroom.kitsunes.world", "https://tube2.nous.media", - "https://peertube.freenet.ru", "https://peertube.0x5e.eu", "https://tube.darknight-coffee.org", "https://play.mittdata.se", - "https://peertube.lhc.net.br", - "https://see.vtopia.live", "https://peertube.letoine.fr", "https://tube-enseignement-professionnel.apps.education.fr", "https://videos.laliguepaysdelaloire.org", "https://quantube.win", "https://twctube.twc-zone.eu", "https://vhs.absturztau.be", - "https://video.espr.moe", "https://peertube.social.my-wan.de", "https://phijkchu.com", "https://video.lycee-experimental.org", - "https://galileo.news", "https://tube.motuhake.xyz", "https://pt.m0r016.net", "https://hitchtube.fr", "https://video.fox-romka.ru", "https://peertube.ctrl-c.liu.se", - "https://peertube.live", "https://video.slipfox.xyz", "https://vnop.org", "https://videos.cassidypunchmachine.com", - "https://tv1.gomntu.space", "https://dalek.zone", "https://seka.pona.la", "https://syop.tv", "https://watch.thelema.social", "https://tube.miegl.cz", "https://mov.clov.fr", - "https://videomensoif.ynh.fr", - "https://videos.neongarden.life", "https://video.vaku.org.ua", "https://videos.trom.lt", "https://vid.mkp.ca", "https://jupiter.tube", - "https://tuvideo.encanarias.info", "https://videos.squat.net", "https://peertube.chaunchy.com", "https://tube.vrpnet.org", @@ -870,32 +916,23 @@ "https://nightshift.minnix.dev", "https://tube.friloux.me", "https://peertube.virtual-assembly.org", - "https://video.olos311.org", "https://peertube.atilla.org", - "https://video.lapineige.fr", - "https://zapping.no-ip.info", "https://tube.azkware.net", "https://video.lunasqu.ee", "https://v.mkp.ca", "https://peertube.eus", "https://infothema.net", "https://tube.nilsu.org", - "https://podlibre.video", - "https://videos.tankernn.eu", "https://watch.autonomous-zone.earth", "https://pirtube.calut.fr", "https://y.melonia.se", - "https://peertube.cirkau.art", - "https://peertube.2i2l.net", "https://videos.martyn.berlin", "https://turkum.me", "https://video.colibris-outilslibres.org", - "https://invoice.peertube.biz", "https://peertube.chantierlibre.org", "https://video.9wd.eu", "https://video.niboe.info", "https://peertuibe.fedsinfo.nohost.me", - "https://s9.gegenstimme.tv", "https://videos.alamaisondulibre.org", "https://videos.tormentasolar.win", "https://tube.nestor.coop", @@ -912,12 +949,9 @@ "https://peertube.bgzashtita.es", "https://tube.genb.de", "https://cliptube.org", - "https://tube.tr4sk.me", "https://videos.campdarling.com", - "https://www.aktion-nordost.tv", "https://tube.rooty.fr", "https://tube.dnet.one", - "https://peertube.io", "https://www.kotikoff.net", "https://peertube.nz", "https://videos.grafo.zone", @@ -929,7 +963,6 @@ "https://peertube.narrativerry.xyz", "https://tube.9minuti.it", "https://krdtube.org", - "https://peertube.elforcer.ru", "https://tubocatodico.bida.im", "https://torstenwitte.peertube-host.de", "https://peertube.hackerfraternity.org", @@ -948,10 +981,7 @@ "https://free-streams.com", "https://tube.pawelko.net", "https://video.livecchi.cloud", - "https://anarchy.video", "https://peertube.gsugambit.com", - "https://media.zat.im", - "https://videos.sadx.moe", "https://pt.nospy.net", "https://yhwh.tube", "https://tube.kicou.info", @@ -962,8 +992,6 @@ "https://peertube.dsmouse.net", "https://ptube.horsentiers.fr", "https://video.cnt.social", - "https://peertube.okko.io", - "https://video.mentality.rip", "https://tube.03281.fspfc.org", "https://tube.linc.systems", "https://peertube.ketchup.noho.st", @@ -976,29 +1004,23 @@ "https://truvitv.com", "https://pt.ilyamikcoder.com", "https://peertube.sensin.eu", - "https://sharetube.us", "https://video.sadmin.io", "https://stream.jurnalfm.md", - "https://video.asgardius.company", "https://video.publicspaces.net", "https://video.eientei.org", "https://tv.suwerenni.org", "https://tube.revertron.com", "https://tube.erzbistum-hamburg.de", "https://views.southfox.me", - "https://vide.oxel.me", "https://video.mttv.it", "https://peertube.cloud.nerdraum.de", "https://vid.pretok.tv", "https://videos.slownewsdayshow.com", "https://videos.sarcasmstardust.com", "https://videos.factsonthegroundshow.com", - "https://video.pe6.eu", "https://tv.santic-zombie.ru", "https://tube.sleeping.town", - "https://tube.globalfrens.com", "https://peertube.hacknews.pmdcollab.org", - "https://freetubes.nohost.me", "https://video.snug.moe", "https://video.avant-le-strike.buzz", "https://videos.ritimo.org", @@ -1021,7 +1043,6 @@ "https://peertube.beardedtek.com", "https://creemoseducacioninclusiva.uma.es", "https://videos.yeswiki.net", - "https://tube.lrk.sh", "https://peertube.autogestioncitoyenne.org", "https://video.r3s.nrw", "https://peertube.semweb.pro", @@ -1030,7 +1051,6 @@ "https://peertube.rse43.com", "https://vid.lelux.fi", "https://v.wolfskaempf.de", - "https://peertube.chevro.fr", "https://media.econoalchemist.com", "https://video.qoto.org", "https://peertube.maxweiss.io", @@ -1039,13 +1059,11 @@ "https://peertube.swarm.solvingmaz.es", "https://film.node9.org", "https://peertube.mi-site.net", - "https://tube.nowtech.io", "https://raptube.antipub.org", "https://video.cm-en-transition.fr", "https://tube.koweb.fr", "https://peertube.genma.fr", "https://tv.generallyrubbish.net.au", - "https://video.travisshears.xyz", "https://videos.codingotaku.com", "https://foss.tube", "https://peertube.satoshishop.de", @@ -1054,18 +1072,14 @@ "https://videos.fsci.in", "https://video.dnfi.no", "https://peertube.revelin.fr", - "https://armstube.com", "https://peertube.ti-fr.com", "https://video.turbo.chat", - "https://tube.toldi.eu", - "https://review.peertube.biz", "https://peertube.am-networks.fr", "https://video.chbmeyer.de", "https://video.rs-einrich.de", "https://p2ptv.ru", "https://peertube.librenet.co.za", "https://h3h3.club", - "https://watch.snoot.tube", "https://tube.freepeople.fr", "https://watch.rt4mn.org", "https://video.lrose.de", @@ -1082,7 +1096,6 @@ "https://video.anartist.org", "https://peertube.home.x0r.fr", "https://peertube.marud.fr", - "https://freetubehub.live", "https://mtube.mooo.com", "https://skeptube.fr", "https://tube.villejuif.fr", @@ -1127,9 +1140,7 @@ "https://live.solari.com", "https://live.codinglab.ch", "https://dud-video.inf.tu-dresden.de", - "https://media-test.interior.edu.uy", "https://media.interior.edu.uy", - "https://phoenixproject.group", "https://peertube.sebu77.com", "https://www.orion-hub.fr", "https://tv.orion-serv.fr", @@ -1170,7 +1181,6 @@ "https://tube.nuxnik.com", "https://tube.froth.zone", "https://peertube.ethibox.fr", - "https://www.freetubehub.live", "https://tube.communia.org", "https://peertube.dragonborn.app", "https://ai-tube.ch", @@ -1182,14 +1192,12 @@ "https://pocketnetpeertube10.nohost.me", "https://tube.io18.top", "https://peertube.remerge.net", - "https://video.wuatek.is", "https://tube.geekyboo.net", "https://notretube.asselma.eu", "https://canal.facil.services", "https://pt.gordons.gen.nz", "https://tube.misterbanal.net", "https://peertube.fomin.site", - "https://peertube.kenjiyon.xyz", "https://tube.g1zm0.de", "https://video.ellijaymakerspace.org", "https://videos.benpro.fr", @@ -1225,14 +1233,12 @@ "https://bideoak.argia.eus", "https://video.hainry.fr", "https://video.gresille.org", - "https://peertube.tangentfox.com", "https://puffy.tube", "https://tube.kher.nl", "https://watch.ocaml.org", "https://peertube.kleph.eu", "https://tube.missbanal.net", "https://pityu.flaki.hu", - "https://tv.catalpafestival.fr", "https://pony.tube", "https://peertube.umeahackerspace.se", "https://tube.okcinfo.news", @@ -1252,7 +1258,6 @@ "https://peertube.scyldings.com", "https://gade.o-k-i.net", "https://peertube.mobilsicher.de", - "https://video.jigmedatse.com", "https://video.amiga-ng.org", "https://peertube.espace.si", "https://videos.supertuxkart.net", @@ -1266,7 +1271,6 @@ "https://peertube.w.utnw.de", "https://tube.sp-codes.de", "https://tube.apolut.net", - "https://tube.mfraters.net", "https://tube.pyngu.com", "https://peertube.troback.com", "https://peertube.ucy.de", @@ -1332,7 +1336,6 @@ "https://peertube.iriseden.eu", "https://video.shitposter.club", "https://tv.mattchristiansenmedia.com", - "https://tube.hackerscop.org", "https://peertube.kx.studio", "https://videos.3d-wolf.com", "https://tube.octaplex.net", @@ -1355,7 +1358,6 @@ "https://tube.frischesicht.de", "https://peertube1.zeteo.me", "https://conspiracydistillery.com", - "https://peertube.chemnitz.freifunk.net", "https://hpstube.fr", "https://video.blast-info.fr", "https://peertube.bubuit.net", @@ -1429,7 +1431,6 @@ "https://evangelisch.video", "https://tube.anufrij.de", "https://videos.mastodont.cat", - "https://video.taboulisme.com", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", "https://peertube.nicolastissot.fr", @@ -1503,11 +1504,9 @@ "https://video.csc49.fr", "https://tube.wolfe.casa", "https://video.dresden.network", - "https://peertube.zapashcanon.fr", "https://40two.tube", "https://tube.amic37.fr", "https://video.comptoir.net", - "https://kino.schuerz.at", "https://peertube.tiennot.net", "https://tututu.tube", "https://tube.picasoft.net", @@ -1520,14 +1519,12 @@ "https://videos.testimonia.org", "https://video.mass-trespass.uk", "https://peertube.cipherbliss.com", - "https://peertube.stemy.me", "https://daschauher.aksel.rocks", "https://tube.cyano.at", "https://tube.nox-rhea.org", "https://peertube.securitymadein.lu", "https://tube.rita.moe", "https://tuktube.com", - "https://v.basspistol.org", "https://mytube.kn-cloud.de", "https://tube.nuagelibre.fr", "https://video.nogafam.es", @@ -1546,9 +1543,7 @@ "https://cinema.yunohost.support", "https://peertube.s2s.video", "https://peertube.travelpandas.eu", - "https://video.sdm-tools.net", "https://peertube.anzui.dev", - "https://video.up.edu.ph", "https://video.igem.org", "https://worldofvids.com", "https://peertube.underworld.fr", @@ -1575,8 +1570,6 @@ "https://video.violoncello.ch", "https://peertube.gidikroon.eu", "https://tubedu.org", - "https://watch.breadtube.tv", - "https://video.exodus-privacy.eu.org", "https://tilvids.com", "https://peertube.devloprog.org", "https://peertube.designersethiques.org", -- cgit 1.4.1 From 0c1595ec3a0f8f38f322f2e70598dbe208151554 Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 19 Sep 2022 17:30:39 +0100 Subject: Changes Made get_instances.py more efficient Further work to get widgets/services.js to work properly --- src/assets/javascripts/services.js | 33 +- src/config/config.json | 171 ++-- src/instances/get_instances.py | 484 ++++-------- src/pages/options/index.ejs | 10 +- src/pages/options/index.html | 1326 ++++++++++---------------------- src/pages/options/widgets/general.ejs | 12 +- src/pages/options/widgets/services.ejs | 61 +- src/pages/options/widgets/services.js | 58 +- src/pages/widgets/links.ejs | 4 +- 9 files changed, 793 insertions(+), 1366 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 70928786..affe0d1a 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -28,8 +28,8 @@ function init() { //cur = current for (const service in config.services) { options[service] = {} - browser.storage.local.get([`disable${utils.camelCase(service)}`, `${service}RedirectType`, `${service}Frontend`], r => { - options[service].disabled = r["disable" + utils.camelCase(service)] + browser.storage.local.get([`${utils.camelCase(service)}Enable`, `${service}RedirectType`, `${service}Frontend`], r => { + options[service].enabled = r[utils.camelCase(service) + "Enable"] options[service].frontend = r[service + "Frontend"] options[service].redirectType = r[service + "RedirectType"] // console.log(r) @@ -60,19 +60,19 @@ function all(service) { return tmp } -getConfig() +await getConfig() init() browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { let randomInstance - let frontend = options[service].frontend + let frontend let network = options.network let networkFallback = options.networkFallback - let redirectType = options[service].redirectType + let redirectType if (url.pathname == "/") return for (const service in config.services) { - if (options[service].disabled && !disableOverride) continue + if (!options[service].enabled && !disableOverride) continue let targets = service.targets if (targets == "datajson") { browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) @@ -81,11 +81,18 @@ function redirect(url, type, initiator) { if (initiator && (all(service).includes(initiator.origin) || targets.includes(initiator.host))) continue if (!targets.some(rx => rx.test(url.href))) continue if (type != redirectType && type != "both") continue + + frontend = options[service].frontend + redirectType = options[service].redirectType + // browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) - let instanceList = [...[service + utils.camelCase(network) + "RedirectsChecks"], ...[service + utils.camelCase(network) + "CustomRedirects"]] - if (instanceList.length === 0 && networkFallback) instanceList = [...[service + "ClearnetRedirectsChecks"], ...[service + "ClearnetCustomRedirects"]] - if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return - randomInstance = utils.getRandomInstance(instanceList) + + if (config.services[service].frontends[frontend].instanceList) { + let instanceList = [...[frontend + utils.camelCase(network) + "RedirectsChecks"], ...[frontend + utils.camelCase(network) + "CustomRedirects"]] + if (instanceList.length === 0 && networkFallback) instanceList = [...[frontend + "ClearnetRedirectsChecks"], ...[frontend + "ClearnetCustomRedirects"]] + if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return + randomInstance = utils.getRandomInstance(instanceList) + } } // Here is a (temperory) space for defining constants required in 2 or more switch cases. @@ -114,7 +121,7 @@ function redirect(url, type, initiator) { .replace("/watch?v=", "/listen?id=") .replace("/channel/", "/artist/") .replace("/playlist?list=", "/playlist/VL") - .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=song") + .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=all") case "hyperpipe": return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) case "bibliogram": @@ -386,7 +393,7 @@ function initDefaults() { // console.log(redirects) // console.log(config) browser.storage.local.set({ - redirects, + redirects: redirects.invidious, }) browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { // console.log(r) @@ -395,7 +402,7 @@ function initDefaults() { browser.storage.local.set({ [service + "Targets"]: redirects[service] }) } for (const defaultOption in config.services[service].defaults) { - browser.storage.local.set({ [defaultOption]: config.services[service].defaults[defaultOption] }) + browser.storage.local.set({ [service + camelCase(defaultOption)]: config.services[service].defaults[defaultOption] }) } for (const frontend in config.services[service].frontends) { let clearnetChecks = redirects[frontend].clearnet diff --git a/src/config/config.json b/src/config/config.json index 7c391552..d0bf7edd 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -24,7 +24,10 @@ "invidious": { "preferences": { "cookies": ["PREFS"] - } + }, + "name": "Invidious", + "embeddable": true, + "instanceList": true }, "piped": { "preferences": { @@ -48,19 +51,38 @@ "volume", "watchHistory" ] - } + }, + "name": "Piped", + "embeddable": true, + "instanceList": true }, "pipedMaterial": { "preferences": { "localstorage": ["PREFERENCES"] - } + }, + "name": "Piped-Material", + "embeddable": false, + "instanceList": true }, "cloudtube": { "preferences": { "token": "token", "fetchEndpoint": "/api/settings", "setEndpoint": "/settings" - } + }, + "name": "CloudTube", + "embeddable": false, + "instanceList": true + }, + "freetube": { + "name": "FreeTube", + "embeddable": false, + "instanceList": false + }, + "yattee": { + "name": "Yattee", + "embeddable": false, + "instanceList": false } }, "singleInstanceFrontends": ["freetube", "yatte"], @@ -74,7 +96,7 @@ ], "name": "Youtube", "options": { - "disabled": false, + "enabled": true, "redirectType": "both", "frontend": "invidious", "embedFrontend": "invidious" @@ -88,19 +110,23 @@ "preferences": { "localstorage": ["settings"], "indexeddb": "beatbump" - } + }, + "name": "Beatbump", + "instanceList": true }, "hyperpipe": { "preferences": { "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], "indexeddb": ["hyperpipedb"] - } + }, + "name": "HyperPipe", + "instanceList": true } }, "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], "name": "YT Music", "options": { - "disabled": false, + "enabled": true, "frontend": "beatbump" }, "imageType": "png", @@ -130,13 +156,16 @@ "replaceTwitter", "replaceYouTube" ] - } + }, + "name": "Nitter", + "embeddable": true, + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], "name": "Twitter", "options": { - "disabled": false, + "enabled": true, "redirectType": "both" }, "imageType": "png", @@ -149,12 +178,14 @@ "token": "token", "fetchEndpoint": "/settings.json", "setEndpoint": "/applysettings" - } + }, + "name": "Bibliogram", + "instanceList": false } }, "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], "name": "Instagram", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -163,12 +194,14 @@ "proxiTok": { "preferences": { "cookies": ["api-test_endpoints", "theme"] - } + }, + "name": "ProxiTok", + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], "name": "TikTok", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -177,7 +210,9 @@ "libreddit": { "preferences": { "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] - } + }, + "name": "Libreddit", + "instanceList": true }, "teddit": { "preferences": { @@ -195,13 +230,15 @@ "theme", "videos_muted" ] - } + }, + "name": "Teddit", + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], "name": "Reddit", "options": { - "disabled": false, + "enabled": true, "frontend": "libreddit" }, "imageType": "png", @@ -210,12 +247,14 @@ "imgur": { "frontends": { "rimgo": { - "preferences": {} + "preferences": {}, + "name": "rimgo", + "instanceList": true } }, "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], "name": "Imgur", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -224,19 +263,23 @@ "wikiless": { "preferences": { "cookies": ["theme", "default_lang"] - } + }, + "name": "Wikiless", + "instanceList": true } }, "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], "name": "Wikipedia", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, "medium": { "frontends": { "scribe": { - "preferences": {} + "preferences": {}, + "name": "Scribe", + "instanceList": true } }, "targets": [ @@ -260,7 +303,7 @@ "^writingcooperative\\.com " ], "name": "Medium", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "svg", "embeddable": false }, @@ -269,12 +312,14 @@ "quetre": { "preferences": { "localstorage": ["theme"] - } + }, + "name": "Quetre", + "instanceList": true } }, "targets": ["^https?:\\/{2}([a-z]+\\.)*quora\\.com.*"], "name": "Quora", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -283,36 +328,42 @@ "libremdb": { "preferences": { "localstorage": ["theme"] - } + }, + "name": "libremdb", + "instanceList": true } }, "targets": ["^https?:\\/{2}(?:www\\.|)imdb\\.com.*"], "name": "IMDb", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, "reuters": { "frontends": { "neuters": { - "preferences": {} + "preferences": {}, + "name": "Neuters", + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|)reuters\\.com.*"], "name": "Reuters", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, "peertube": { "frontends": { "simpleertube": { - "preferences": {} + "preferences": {}, + "name": "SimpleerTube", + "instanceList": true } }, "targets": "datajson", "name": "PeerTube", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, @@ -322,14 +373,21 @@ "preferences": { "cookies": ["nsfw", "theme"], "localstorage": ["autoplay", "autoplayNextVid", "collapseComments", "plyr", "sb_categories", "showRelated"] - } + }, + "name": "Librarian", + "embeddable": true, + "instanceList": true + }, + "lbryDesktop": { + "name": "LBRY Desktop", + "embeddable": false, + "instanceList": false } }, - "singleInstanceFrontends": ["lbryDesktop"], "targets": ["^https?:\\/{2}odysee\\.com", "^https?:\\/{2}lbry\\.tv"], "name": "LBRY", "options": { - "disabled": true, + "enabled": false, "frontend": "librarian", "redirectType": "both" }, @@ -359,7 +417,9 @@ "theme", "tokens" ] - } + }, + "name": "SearX", + "instanceList": true }, "searxng": { "preferences": { @@ -384,21 +444,27 @@ "theme", "tokens" ] - } + }, + "name": "SearXNG", + "instanceList": true }, "whoogle": { - "preferences": {} + "preferences": {}, + "name": "Whoogle", + "instanceList": true }, "librex": { "preferences": { "cookies": ["bibliogram", "disable_special", "invidious", "libreddit", "nitter", "proxitok", "theme", "wikiless"] - } + }, + "name": "LibreX", + "instanceList": true } }, "targets": ["^https?:\\/{2}search\\.libredirect\\.invalid"], "name": "Search", "options": { - "disabled": false, + "enabled": true, "frontend": "searxng" }, "imageType": "svg", @@ -409,18 +475,22 @@ "simplyTranslate": { "preferences": { "cookies": ["from_lang", "to_lang", "tts_enabled", "use_text_fields"] - } + }, + "name": "SimplyTranslate", + "instanceList": true }, "lingva": { "preferences": { "localstorage": ["isauto", "source", "target"] - } + }, + "name": "Lingva", + "instanceList": true } }, "targets": ["^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/"], "name": "Translate", "options": { - "disabled": false, + "enabled": true, "frontend": "simplyTranslate" }, "imageType": "svg", @@ -429,14 +499,19 @@ "maps": { "frontends": { "facil": { - "preferences": {} + "preferences": {}, + "name": "FacilMap", + "instanceList": true + }, + "osm": { + "name": "OpenStreetMap", + "instanceList": false } }, - "singleInstanceFrontends": ["osm"], "targets": ["^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)"], "name": "Maps", "options": { - "disabled": false, + "enabled": true, "frontend": "osm" }, "imageType": "svg", @@ -445,12 +520,14 @@ "sendTargets": { "frontends": { "send": { - "preferences": {} + "preferences": {}, + "name": "Send", + "instanceList": "true" } }, "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid\\/$", "^https?:\\/{2}send\\.firefox\\.com\\/$", "^https?:\\/{2}sendfiles\\.online\\/$"], "name": "Send Files", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "svg", "embeddable": false } diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index a95eb46f..770f2581 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -3,12 +3,10 @@ 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 mightyList = {} @@ -18,6 +16,11 @@ torRegex = startRegex + "onion" + endRegex i2pRegex = startRegex + "i2p" + endRegex lokiRegex = startRegex + "loki" + endRegex authRegex = "https?:\/{2}\S+:\S+@(?:[^\s\/]+\.)+[a-zA-Z0-9]+" + endRegex +config = {} + +with open('./config/config.json') as file: + config = file + def filterLastSlash(urlList): tmp = {} @@ -102,70 +105,162 @@ def is_offline(url): except: return False +def fetchCache(frontend, name) : + # json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) + with open('./src/instances/data.json') as file: + mightyList[frontend] = json.load(file).frontend + print(Fore.ORANGE + 'Failed' + Style.RESET_ALL + ' to fetch ' + name) + +def fetchFromFile(frontend, name): + #json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) + with open('./src/instances/' + frontend + '.json') as file: + mightyList[frontend] = json.load(file) + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + +def fetchJsonList(frontend, name, url, urlItem): + try: + r = requests.get(url) + rJson = json.loads(r.text) + _list = {} + for network in config.networks: + _list[network] = [] + if type(urlItem) is 'str': + for item in rJson: + if urlItem is not None: + tmpUrl = item[urlItem] + else: + tmpUrl = item + if tmpUrl.strip() == "": + continue + elif re.search(torRegex, tmpUrl): + _list['tor'].append(tmpUrl) + elif re.search(i2pRegex, tmpUrl): + _list['i2p'].append(tmpUrl) + elif re.search(lokiRegex, tmpUrl): + _list['loki'].append(tmpUrl) + else: + _list['clearnet'].append(tmpUrl) + else: + for i in range(config.networks.length): + # The expected order is the same as in config.json. If the frontend doesn't have any instances for a specified network, use None + if urlItem != None: + for item in rJson: + if network in item: + if item[network].strip() != "": + _list[config.networks[i]].append(item[urlItem[i]]) + + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) + +def fetchRegexList(frontend, name, url, regex): + try: + r = requests.get(url) + _list = {} + for network in config.networks: + _list[network] = [] + + tmp = re.findall(regex, r.text) + + for item in tmp: + if item.strip() == "": + continue + elif re.search(torRegex, item): + _list['tor'].append(item) + elif re.search(i2pRegex, item): + _list['i2p'].append(item) + elif re.search(lokiRegex, item): + _list['loki'].append(item) + else: + _list['clearnet'].append(item) + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) + +def fetchTextList(frontend, name, url, prepend): + try: + r = requests.get(url) + tmp = r.text.strip().split('\n') + + _list = {} + for network in config.networks: + _list[network] = [] + + for item in tmp: + item = prepend + item + if re.search(torRegex, item): + _list['tor'].append(item) + elif re.search(i2pRegex, item): + _list['i2p'].append(item) + elif re.search(lokiRegex, item): + _list['loki'].append(item) + else: + _list['clearnet'].append(item) + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) + def invidious(): - r = requests.get('https://api.invidious.io/instances.json') - rJson = json.loads(r.text) - invidiousList = {} - invidiousList['clearnet'] = [] - invidiousList['tor'] = [] - invidiousList['i2p'] = [] - invidiousList['loki'] = [] - for instance in rJson: - if instance[1]['type'] == 'https': - invidiousList['clearnet'].append(instance[1]['uri']) - elif instance[1]['type'] == 'onion': - invidiousList['tor'].append(instance[1]['uri']) - mightyList['invidious'] = invidiousList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Invidious') + name = 'Invidious' + frontend = 'invidious' + try: + _list = {} + _list['clearnet'] = [] + _list['tor'] = [] + _list['i2p'] = [] + _list['loki'] = [] + r = requests.get('https://api.invidious.io/instances.json') + rJson = json.loads(r.text) + for instance in rJson: + if instance[1]['type'] == 'https': + _list['clearnet'].append(instance[1]['uri']) + elif instance[1]['type'] == 'onion': + _list['tor'].append(instance[1]['uri']) + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) def piped(): - r = requests.get( - 'https://raw.githubusercontent.com/wiki/TeamPiped/Piped/Instances.md') - - tmp = re.findall( - '(?:[^\s\/]+\.)+[a-zA-Z]+ (?:\(Official\) )?\| (https:\/{2}(?:[^\s\/]+\.)+[a-zA-Z]+) \| ', r.text) - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - for item in tmp: - try: - url = requests.get(item, timeout=5).url - if url.strip("/") == item: + frontend = 'piped' + name = 'Piped' + try: + _list = {} + _list['clearnet'] = [] + _list['tor'] = [] + _list['i2p'] = [] + _list['loki'] = [] + r = requests.get( + 'https://raw.githubusercontent.com/wiki/TeamPiped/Piped/Instances.md') + + tmp = re.findall( + '(?:[^\s\/]+\.)+[a-zA-Z]+ (?:\(Official\) )?\| (https:\/{2}(?:[^\s\/]+\.)+[a-zA-Z]+) \| ', r.text) + for item in tmp: + try: + url = requests.get(item, timeout=5).url + if url.strip("/") == item: + continue + else: + _list['clearnet'].append(url) + except: continue - else: - _list['clearnet'].append(url) - except: - continue - mightyList['piped'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Piped') + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) def pipedMaterial(): - r = requests.get( - 'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md') - - tmp = re.findall( - r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\|", r.text) - pipedMaterialList = {} - pipedMaterialList['clearnet'] = [] - pipedMaterialList['tor'] = [] - pipedMaterialList['i2p'] = [] - pipedMaterialList['loki'] = [] - for item in tmp: - pipedMaterialList['clearnet'].append(item) - mightyList['pipedMaterial'] = pipedMaterialList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'pipedMaterial') + fetchRegexList('pipedMaterial', 'Piped-Material', 'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md', r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\|") def cloudtube(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/cloudtube.json') as file: - mightyList['cloudtube'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'CloudTube') + fetchCache('cloudtube', 'Cloudtube') def proxitok(): @@ -186,19 +281,7 @@ def proxitok(): def send(): - r = requests.get( - 'https://gitlab.com/timvisee/send-instances/-/raw/master/README.md') - tmp = re.findall( - r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}", r.text) - sendList = {} - sendList['clearnet'] = [] - sendList['tor'] = [] - sendList['i2p'] = [] - sendList['loki'] = [] - for item in tmp: - sendList['clearnet'].append(item) - mightyList['send'] = sendList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Send') + fetchRegexList('send', 'Send', 'https://gitlab.com/timvisee/send-instances/-/raw/master/README.md', r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}") def nitter(): @@ -230,150 +313,35 @@ def nitter(): def bibliogram(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/bibliogram.json') as file: - mightyList['bibliogram'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Bibliogram') + fetchFromFile('bibliogram', 'Bibliogram') def libreddit(): - r = requests.get( - 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md') - libredditList = {} - libredditList['clearnet'] = [] - libredditList['tor'] = [] - libredditList['i2p'] = [] - libredditList['loki'] = [] - - tmp = re.findall( - r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text) - - for item in tmp: - if re.search(torRegex, item): - libredditList['tor'].append(item) - else: - libredditList['clearnet'].append(item) - mightyList['libreddit'] = libredditList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LibReddit') + fetchRegexList('libreddit', 'Libreddit', 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md', r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|") def teddit(): - r = requests.get( - 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json') - rJson = json.loads(r.text) - tedditList = {} - tedditList['clearnet'] = [] - tedditList['tor'] = [] - tedditList['i2p'] = [] - tedditList['loki'] = [] - for item in rJson: - url = item['url'] - if url != '': - tedditList['clearnet'].append(url) - if 'onion' in item: - onion = item['onion'] - if onion != '': - tedditList['tor'].append(onion) - - mightyList['teddit'] = tedditList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Teddit') + fetchJsonList('teddit', 'Teddit', 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json', ['url', 'onion', 'i2p', None]) def wikiless(): - r = requests.get('https://wikiless.org/instances.json') - rJson = json.loads(r.text) - wikilessList = {} - wikilessList['clearnet'] = [] - wikilessList['tor'] = [] - wikilessList['i2p'] = [] - wikilessList['loki'] = [] - for item in rJson: - if 'url' in item: - if item['url'].strip() != "": - wikilessList['clearnet'].append(item['url']) - if 'onion' in item: - if item['onion'].strip() != "": - wikilessList['tor'].append(item['onion']) - if 'i2p' in item: - if item['i2p'].strip() != "": - wikilessList['i2p'].append(item['i2p']) - mightyList['wikiless'] = wikilessList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Wikiless') + fetchJsonList('wikiless', 'Wikiless', 'https://wikiless.org/instances.json', ['url', 'onion', 'i2p', None]) def scribe(): - r = requests.get( - 'https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json') - rJson = json.loads(r.text) - scribeList = {} - scribeList['clearnet'] = [] - scribeList['tor'] = [] - scribeList['i2p'] = [] - scribeList['loki'] = [] - for item in rJson: - scribeList['clearnet'].append(item) - mightyList['scribe'] = scribeList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Scribe') + fetchJsonList('scribe', 'Scribe', 'https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json', None) def quetre(): - r = requests.get( - 'https://raw.githubusercontent.com/zyachel/quetre/main/README.md') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - - tmp = re.findall( - r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text) - - - for item in tmp: - if re.search(torRegex, item): - _list['tor'].append(item) - else: - _list['clearnet'].append(item) - mightyList['quetre'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Quetre') + fetchRegexList('quetre', 'Quetre', 'https://raw.githubusercontent.com/zyachel/quetre/main/README.md', r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|") def libremdb(): - r = requests.get( - 'https://raw.githubusercontent.com/zyachel/libremdb/main/README.md') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - - tmp = re.findall( - r"\| ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)*\|*[A-Z]{0,}.*\|.*\|", r.text) + fetchRegexList('libremdb', 'libremdb', 'https://raw.githubusercontent.com/zyachel/libremdb/main/README.md', r"\| ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)*\|*[A-Z]{0,}.*\|.*\|") - for item in tmp: - if item.strip() == "": - continue - if re.search(torRegex, item): - _list['tor'].append(item) - else: - _list['clearnet'].append(item) - - mightyList['libremdb'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Libremdb') - def simpleertube(): - r = requests.get('https://simple-web.org/instances/simpleertube') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - for item in r.text.strip().split('\n'): - _list['clearnet'].append('https://' + item) - - mightyList['simpleertube'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SimpleerTube') + fetchTextList('simpleertube', 'SimpleerTube', 'https://simple-web.org/instances/simpleertube', 'https://') def simplytranslate(): @@ -403,19 +371,7 @@ def simplytranslate(): def linvgatranslate(): - r = requests.get( - 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json') - rJson = json.loads(r.text) - lingvaList = {} - lingvaList['clearnet'] = [] - lingvaList['tor'] = [] - lingvaList['i2p'] = [] - lingvaList['loki'] = [] - for item in rJson: - lingvaList['clearnet'].append(item) - - mightyList['lingva'] = lingvaList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LinvgaTranslate') + fetchJsonList('lingva', 'LingvaTranslate', 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json', None) def searx_searxng(): @@ -454,140 +410,34 @@ def searx_searxng(): def whoogle(): - r = requests.get( - 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt') - tmpList = r.text.strip().split('\n') - whoogleList = {} - whoogleList['clearnet'] = [] - whoogleList['tor'] = [] - whoogleList['i2p'] = [] - whoogleList['loki'] = [] - for item in tmpList: - if re.search(torRegex, item): - whoogleList['tor'].append(item) - elif re.search(torRegex, item): - whoogleList['i2p'].append(item) - else: - whoogleList['clearnet'].append(item) - mightyList['whoogle'] = whoogleList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Whoogle') + fetchTextList('whoogle', 'Whoogle', 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt', '') def librex(): - r = requests.get( - 'https://raw.githubusercontent.com/hnhx/librex/main/README.md') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - - tmp = re.findall( - r"\| {1,2}\[(?:(?:[a-zA-Z0-9]+\.)+[a-zA-Z]{2,}|✅)\]\((https?:\/{2}(?:[a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,})", r.text) - - for item in tmp: - if item.strip() == "": - continue - elif re.search(torRegex, item): - _list['tor'].append(item) - elif re.search(i2pRegex, item): - _list['i2p'].append(item) - else: - _list['clearnet'].append(item) - mightyList['librex'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librex') + fetchRegexList('librex', 'LibreX', 'https://raw.githubusercontent.com/hnhx/librex/main/README.md', r"\| {1,2}\[(?:(?:[a-zA-Z0-9]+\.)+[a-zA-Z]{2,}|✅)\]\((https?:\/{2}(?:[a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,})") def rimgo(): - r = requests.get( - 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json') - rJson = json.loads(r.text) - rimgoList = {} - rimgoList['clearnet'] = [] - rimgoList['tor'] = [] - rimgoList['i2p'] = [] - rimgoList['loki'] = [] - for item in rJson: - if 'url' in item: - rimgoList['clearnet'].append(item['url']) - if 'onion' in item: - rimgoList['tor'].append(item['onion']) - if 'i2p' in item: - rimgoList['i2p'].append(item['i2p']) - mightyList['rimgo'] = rimgoList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Rimgo') + fetchJsonList('rimgo', 'rimgo', 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json', ['url', 'onion', 'i2p', None]) def librarian(): - r = requests.get( - 'https://codeberg.org/librarian/librarian/raw/branch/main/instances.json') - rJson = json.loads(r.text) - librarianList = {} - librarianList['clearnet'] = [] - librarianList['tor'] = [] - librarianList['i2p'] = [] - librarianList['loki'] = [] - instances = rJson['instances'] - for item in instances: - url = item['url'] - if url.strip() == "": - continue - elif re.search(torRegex, url): - librarianList['tor'].append(url) - elif re.search(i2pRegex, url): - librarianList['i2p'].append(url) - elif re.search(lokiRegex, url): - librarianList['loki'].append(url) - else: - librarianList['clearnet'].append(url) - mightyList['librarian'] = librarianList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librarian') - + fetchJsonList('librarian', 'Librarian', 'https://codeberg.org/librarian/librarian/raw/branch/main/instances.json', 'url') def neuters(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/neuters.json') as file: - mightyList['neuters'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Neuters') + fetchFromFile('neuters', 'Neuters') def beatbump(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/beatbump.json') as file: - mightyList['beatbump'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Beatbump') + fetchFromFile('beatbump', 'Beatbump') def hyperpipe(): - r = requests.get( - 'https://codeberg.org/Hyperpipe/pages/raw/branch/main/api/frontend.json') - rJson = json.loads(r.text) - hyperpipeList = {} - hyperpipeList['clearnet'] = [] - hyperpipeList['tor'] = [] - hyperpipeList['i2p'] = [] - hyperpipeList['loki'] = [] - for item in rJson: - url = item['url'] - if url.strip() == "": - continue - elif re.search(torRegex, url): - hyperpipeList['tor'].append(url) - elif re.search(i2pRegex, url): - hyperpipeList['i2p'].append(url) - elif re.search(lokiRegex, url): - hyperpipeList['loki'].append(url) - else: - hyperpipeList['clearnet'].append(url) - mightyList['hyperpipe'] = hyperpipeList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Hyperpipe') + fetchJsonList('hyperpipe', 'Hyperpipe', 'https://codeberg.org/Hyperpipe/pages/raw/branch/main/api/frontend.json', 'url') def facil(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/facil.json') as file: - mightyList['facil'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'FacilMap') + fetchFromFile('facil', 'FacilMap') def peertube(): diff --git a/src/pages/options/index.ejs b/src/pages/options/index.ejs index 0240f992..e0ce3c3c 100644 --- a/src/pages/options/index.ejs +++ b/src/pages/options/index.ejs @@ -1,12 +1,12 @@ - <%- include('src/pages/widgets/head') %> + <%- include('src/pages/widgets/head') -%> - <%- include('src/pages/widgets/links', {config: config}) %> + <%- include('src/pages/widgets/links', {config: config}) -%>
- <%- include('src/pages/options/widgets/general', {config: config}) %> - <%- include('src/pages/options/widgets/services', {config: config}) %> - <%- include('src/pages/options/widgets/about') %> + <%- include('src/pages/options/widgets/general', {config: config}) -%> + <%- include('src/pages/options/widgets/services', {config: config}) -%> + <%- include('src/pages/options/widgets/about') -%>
diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 8908c9bf..df6bec2a 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -8,50 +8,29 @@ General - -
@@ -69,16 +48,12 @@

+
@@ -145,126 +120,108 @@

Customize Popup

- - -
+

Youtube


Enable

- +
-

Frontend

- +

Frontend

+
- - -
+

Embed Frontend

- - -
+

Redirect Type

- - - + +
- -
- -
- -
+
+
+

Default Instances

@@ -359,8 +294,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -392,10 +324,8 @@
- -
- -
+
+

Default Instances

@@ -415,10 +345,8 @@
- -
- -
+
+

Default Instances

@@ -438,14 +366,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -465,8 +390,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -498,10 +420,8 @@
- -
- -
+
+

Default Instances

@@ -521,10 +441,8 @@
- -
- -
+
+

Default Instances

@@ -544,14 +462,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -571,8 +486,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -604,10 +516,8 @@
- -
- -
+
+

Default Instances

@@ -627,10 +537,8 @@
- -
- -
+
+

Default Instances

@@ -650,14 +558,11 @@
- -
+ - -
- -
+
+

Default Instances

@@ -677,8 +582,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -710,10 +612,8 @@
- -
- -
+
+

Default Instances

@@ -733,10 +633,8 @@
- -
- -
+
+

Default Instances

@@ -756,13 +654,11 @@
- -
+ - +
-

YT Music

@@ -770,28 +666,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -811,8 +699,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -844,10 +729,8 @@
- -
- -
+
+

Default Instances

@@ -867,10 +750,8 @@
- -
- -
+
+

Default Instances

@@ -890,14 +771,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -917,8 +795,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -950,10 +825,8 @@
- -
- -
+
+

Default Instances

@@ -973,10 +846,8 @@
- -
- -
+
+

Default Instances

@@ -996,13 +867,11 @@
- -
+ - +
-

Twitter

@@ -1010,25 +879,19 @@

Enable

- +
- - - -
+

Redirect Type

- - - + +
- -
- -
- -
+
+
+

Default Instances

@@ -1048,8 +911,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1081,10 +941,8 @@
- -
- -
+
+

Default Instances

@@ -1104,10 +962,8 @@
- -
- -
+
+

Default Instances

@@ -1127,13 +983,11 @@
- -
+
- +
-

Instagram

@@ -1141,121 +995,11 @@

Enable

- +
- - - -
- -
- -
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- -
- - -
- -
- -
-
-

Default Instances

-
-

-
-

Custom Instances

-
-
-
- - -
-
-
-
- -
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- -
- -
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- -
- -
-
-

TikTok

@@ -1263,16 +1007,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1292,8 +1031,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1325,10 +1061,8 @@
- -
- -
+
+

Default Instances

@@ -1348,10 +1082,8 @@
- -
- -
+
+

Default Instances

@@ -1371,13 +1103,11 @@
- -
+
- +
-

Reddit

@@ -1385,28 +1115,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -1426,8 +1148,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1459,10 +1178,8 @@
- -
- -
+
+

Default Instances

@@ -1482,10 +1199,8 @@
- -
- -
+
+

Default Instances

@@ -1505,14 +1220,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1532,8 +1244,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1565,10 +1274,8 @@
- -
- -
+
+

Default Instances

@@ -1588,10 +1295,8 @@
- -
- -
+
+

Default Instances

@@ -1611,13 +1316,11 @@
- -
+ - +
-

Imgur

@@ -1625,16 +1328,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1654,8 +1352,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1687,10 +1382,8 @@
- -
- -
+
+

Default Instances

@@ -1710,10 +1403,8 @@
- -
- -
+
+

Default Instances

@@ -1733,13 +1424,11 @@
- -
+
- +
-

Wikipedia

@@ -1747,16 +1436,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1776,8 +1460,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1809,10 +1490,8 @@
- -
- -
+
+

Default Instances

@@ -1832,10 +1511,8 @@
- -
- -
+
+

Default Instances

@@ -1855,13 +1532,11 @@
- -
+
- +
-

Medium

@@ -1869,16 +1544,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1898,8 +1568,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1931,10 +1598,8 @@
- -
- -
+
+

Default Instances

@@ -1954,10 +1619,8 @@
- -
- -
+
+

Default Instances

@@ -1977,13 +1640,11 @@
- -
+
- +
-

Quora

@@ -1991,16 +1652,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2020,8 +1676,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2053,10 +1706,8 @@
- -
- -
+
+

Default Instances

@@ -2076,10 +1727,8 @@
- -
- -
+
+

Default Instances

@@ -2099,13 +1748,11 @@
- -
+
- +
-

IMDb

@@ -2113,16 +1760,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2142,8 +1784,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2175,10 +1814,8 @@
- -
- -
+
+

Default Instances

@@ -2198,10 +1835,8 @@
- -
- -
+
+

Default Instances

@@ -2221,13 +1856,11 @@
- -
+
- +
-

Reuters

@@ -2235,16 +1868,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2264,8 +1892,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2297,10 +1922,8 @@
- -
- -
+
+

Default Instances

@@ -2320,10 +1943,8 @@
- -
- -
+
+

Default Instances

@@ -2343,13 +1964,11 @@
- -
+
- +
-

PeerTube

@@ -2357,16 +1976,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2386,8 +2000,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2419,10 +2030,8 @@
- -
- -
+
+

Default Instances

@@ -2442,10 +2051,8 @@
- -
- -
+
+

Default Instances

@@ -2465,13 +2072,11 @@
- -
+
- +
-

LBRY

@@ -2479,37 +2084,37 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
+
+
+

Embed Frontend

+ +
+
+

Redirect Type

- - - + +
- -
- -
- -
+
+
+

Default Instances

@@ -2529,8 +2134,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2562,10 +2164,8 @@
- -
- -
+
+

Default Instances

@@ -2585,10 +2185,8 @@
- -
- -
+
+

Default Instances

@@ -2608,13 +2206,11 @@
- -
+
- +
-

Search

@@ -2622,32 +2218,22 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -2667,8 +2253,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2700,10 +2283,8 @@
- -
- -
+
+

Default Instances

@@ -2723,10 +2304,8 @@
- -
- -
+
+

Default Instances

@@ -2746,14 +2325,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2773,8 +2349,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2806,10 +2379,8 @@
- -
- -
+
+

Default Instances

@@ -2829,10 +2400,8 @@
- -
- -
+
+

Default Instances

@@ -2852,14 +2421,11 @@
- -
+ - -
- -
+
+

Default Instances

@@ -2879,8 +2445,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2912,10 +2475,8 @@
- -
- -
+
+

Default Instances

@@ -2935,10 +2496,8 @@
- -
- -
+
+

Default Instances

@@ -2958,14 +2517,11 @@
- -
+ - -
- -
+
+

Default Instances

@@ -2985,8 +2541,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3018,10 +2571,8 @@
- -
- -
+
+

Default Instances

@@ -3041,10 +2592,8 @@
- -
- -
+
+

Default Instances

@@ -3064,13 +2613,11 @@
- -
+ - +
-

Translate

@@ -3078,28 +2625,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -3119,8 +2658,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3152,10 +2688,8 @@
- -
- -
+
+

Default Instances

@@ -3175,10 +2709,8 @@
- -
- -
+
+

Default Instances

@@ -3198,14 +2730,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3225,8 +2754,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3258,10 +2784,8 @@
- -
- -
+
+

Default Instances

@@ -3281,10 +2805,8 @@
- -
- -
+
+

Default Instances

@@ -3304,13 +2826,11 @@
- -
+ - +
-

Maps

@@ -3318,28 +2838,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -3359,8 +2871,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3392,10 +2901,8 @@
- -
- -
+
+

Default Instances

@@ -3415,10 +2922,8 @@
- -
- -
+
+

Default Instances

@@ -3438,13 +2943,11 @@
- -
+
- +
-

Send Files

@@ -3452,16 +2955,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -3481,8 +2979,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3514,10 +3009,8 @@
- -
- -
+
+

Default Instances

@@ -3537,10 +3030,8 @@
- -
- -
+
+

Default Instances

@@ -3560,15 +3051,13 @@
- -
+
- +
-

About

@@ -3593,7 +3082,6 @@
- diff --git a/src/pages/options/widgets/general.ejs b/src/pages/options/widgets/general.ejs index 05ef0959..d68a2280 100644 --- a/src/pages/options/widgets/general.ejs +++ b/src/pages/options/widgets/general.ejs @@ -14,10 +14,10 @@

+
@@ -84,14 +84,14 @@

Customize Popup

diff --git a/src/pages/options/widgets/services.ejs b/src/pages/options/widgets/services.ejs index aed5872b..bc75f288 100644 --- a/src/pages/options/widgets/services.ejs +++ b/src/pages/options/widgets/services.ejs @@ -1,4 +1,4 @@ -<% for (const service in config.services) { %> +<% for (const service in config.services) { -%>

<%= config.services[service].name %>

@@ -6,47 +6,47 @@

Enable

- +
- <% if ((Object.keys(config.services[service].frontends).length > 1) || config.services[service].singleInstanceFrontends) { %> + <% if (Object.keys(config.services[service].frontends).length > 1) { %>
-

Frontend

- +

Frontend

+
- <% } %> - <% if ((config.services[service].singleInstanceFrontends) && (Object.keys(config.services[service].frontends).length > 1)) { %> -
+ <% if (config.services[service].embeddable) { _%> +

Embed Frontend

- <% } %> - <% if (config.services[service].embeddable) { %> + <% } _%> + <% } _%> + <% if (config.services[service].embeddable) { _%>

Redirect Type

- - - + +
- <% } %> + <% } _%>
- <% for (const frontend in config.services[service].frontends) { %> + <% for (const frontend in config.services[service].frontends) { -%> + <% if (config.services[service].frontends[frontend].instanceList) { _%>
- <% for (const network in config.networks) { %> + <% for (const network in config.networks) { -%>

Default Instances

@@ -67,7 +67,7 @@
- <% if (network == "clearnet") { %> + <% if (network == "clearnet") { _%>
- <% } %> + <% } _%>
- <% }; %> + <% } %>
- <% }; %> + <% } _%> + <% } %>
-<% }; %> +<% } %> diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index c7955b40..4a53a749 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -1,13 +1,10 @@ import utils from "../../../assets/javascripts/utils.js" -// const frontends = new Array("librarian") -// const protocols = new Array("clearnet", "tor", "i2p", "loki") - let config, network, divs = {} -async function getConfig() { +function getConfig() { return new Promise(resolve => { fetch("/config/config.json") .then(response => response.text()) @@ -19,7 +16,7 @@ async function getConfig() { }) } -getConfig() +await getConfig() browser.storage.local.get("network", r => { network = r.network @@ -27,45 +24,50 @@ browser.storage.local.get("network", r => { function changeFrontendsSettings(service) { for (const frontend in config.services[service].frontends) { - const frontendDiv = document.getElementById(frontend) - if (frontend == divs[service].frontend.value) { - frontendDiv.style.display = "block" - } else { - frontendDiv.style.display = "none" + if (config.services[service].frontends[frontend].instanceList && config.services[service].frontends.length > 1) { + const frontendDiv = document.getElementById(frontend) + if (divs[service].frontend == null) { + console.log(frontend) + } + if (frontend == divs[service].frontend.value) { + frontendDiv.style.display = "block" + } else { + frontendDiv.style.display = "none" + } } } } function changeNetworkSettings(selectedNetwork) { for (const frontend in config.frontends) { - const frontendDiv = document.getElementById(frontend) - for (const network in config.networks) { - const networkDiv = frontendDiv.getElementsByClassName(network)[0] - if (network == selectedNetwork) { - networkDiv.style.display = "block" - } else { - networkDiv.style.display = "none" + if (config.services[service].frontends[frontend].instanceList) { + const frontendDiv = document.getElementById(frontend) + for (const network in config.networks) { + const networkDiv = frontendDiv.getElementsByClassName(network)[0] + if (network == selectedNetwork) { + networkDiv.style.display = "block" + } else { + networkDiv.style.display = "none" + } } } } } -for (service in config.services) { +for (const service in config.services) { + divs[service] = {} divs[service][service] = document.getElementById(`${service}_page`) for (const option in config.services[service].options) { divs[service][option] = document.getElementById(`${service}-${option}`) browser.storage.local.get([`${service + utils.camelCase(option)}`], r => { - if (typeof config.services[service].options[option] == "boollean") divs[service][option].checked = !r[service + utils.camelCase(option)] + if (typeof config.services[service].options[option] == "boollean") divs[service][option].checked = r[service + utils.camelCase(option)] else divs[service][option].value = !r[service + utils.camelCase(option)] }) divs[service][option].addEventListener("change", () => { - if (typeof config.services[service].options[option] == "boollean") { - browser.storage.local.set({ [service + utils.camelCase(option)]: !divs[service][option].checked }) - } else { - browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].value }) - } + if (typeof config.services[service].options[option] == "boollean") browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].checked }) + else browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].value }) changeFrontendsSettings() }) } @@ -74,9 +76,11 @@ for (service in config.services) { changeNetworkSettings(network) for (const frontend in config.services[service].frontends) { - for (const network in config.networks) { - utils.processDefaultCustomInstances(service, frontend, network, document) + if (config.services[service].frontends[frontend].instanceList) { + for (const network in config.networks) { + utils.processDefaultCustomInstances(service, frontend, network, document) + } + utils.latency(service, frontend, document, location) } - utils.latency(service, frontend, document, location) } } diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index fe0cd37c..c28d3668 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -1,7 +1,7 @@ -- cgit 1.4.1 From 098e7368a743b61f36e920e2e01df764441786b6 Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 19 Sep 2022 19:52:26 +0100 Subject: Fixed bugs introduced in the previous commit --- src/instances/get_instances.py | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 770f2581..3dcb42b4 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -9,6 +9,7 @@ from urllib.parse import urlparse import socket mightyList = {} +config = {} startRegex = "https?:\/{2}(?:[^\s\/]+\.)+" endRegex = "(?:\/[^\s\/]+)*\/?" @@ -16,10 +17,10 @@ torRegex = startRegex + "onion" + endRegex i2pRegex = startRegex + "i2p" + endRegex lokiRegex = startRegex + "loki" + endRegex authRegex = "https?:\/{2}\S+:\S+@(?:[^\s\/]+\.)+[a-zA-Z0-9]+" + endRegex -config = {} -with open('./config/config.json') as file: - config = file +with open('./src/config/config.json', 'rt') as tmp: + config['networks'] = json.load(tmp)['config']['networks'] + def filterLastSlash(urlList): @@ -108,8 +109,8 @@ def is_offline(url): def fetchCache(frontend, name) : # json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) with open('./src/instances/data.json') as file: - mightyList[frontend] = json.load(file).frontend - print(Fore.ORANGE + 'Failed' + Style.RESET_ALL + ' to fetch ' + name) + mightyList[frontend] = json.load(file)[frontend] + print(Fore.YELLOW + 'Failed' + Style.RESET_ALL + ' to fetch ' + name) def fetchFromFile(frontend, name): #json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) @@ -122,32 +123,31 @@ def fetchJsonList(frontend, name, url, urlItem): r = requests.get(url) rJson = json.loads(r.text) _list = {} - for network in config.networks: + for network in config['networks']: _list[network] = [] - if type(urlItem) is 'str': + if type(urlItem) == 'str': for item in rJson: + tmpItem = item if urlItem is not None: - tmpUrl = item[urlItem] - else: - tmpUrl = item - if tmpUrl.strip() == "": + tmpItem = item[urlItem] + if tmpItem.strip() == '': continue - elif re.search(torRegex, tmpUrl): - _list['tor'].append(tmpUrl) - elif re.search(i2pRegex, tmpUrl): - _list['i2p'].append(tmpUrl) - elif re.search(lokiRegex, tmpUrl): - _list['loki'].append(tmpUrl) + elif re.search(torRegex, tmpItem): + _list['tor'].append(tmpItem) + elif re.search(i2pRegex, tmpItem): + _list['i2p'].append(tmpItem) + elif re.search(lokiRegex, tmpItem): + _list['loki'].append(tmpItem) else: - _list['clearnet'].append(tmpUrl) + _list['clearnet'].append(tmpItem) else: - for i in range(config.networks.length): + for i in range(len(config['networks']) - 1): # The expected order is the same as in config.json. If the frontend doesn't have any instances for a specified network, use None if urlItem != None: for item in rJson: if network in item: - if item[network].strip() != "": - _list[config.networks[i]].append(item[urlItem[i]]) + if item[network].strip() != '': + _list[config['networks'][i]].append(item[urlItem[i]]) mightyList[frontend] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) @@ -158,7 +158,7 @@ def fetchRegexList(frontend, name, url, regex): try: r = requests.get(url) _list = {} - for network in config.networks: + for network in config['networks']: _list[network] = [] tmp = re.findall(regex, r.text) @@ -185,7 +185,7 @@ def fetchTextList(frontend, name, url, prepend): tmp = r.text.strip().split('\n') _list = {} - for network in config.networks: + for network in config['networks']: _list[network] = [] for item in tmp: @@ -207,13 +207,14 @@ def fetchTextList(frontend, name, url, prepend): def invidious(): name = 'Invidious' frontend = 'invidious' + url = 'https://api.invidious.io/instances.json' try: _list = {} _list['clearnet'] = [] _list['tor'] = [] _list['i2p'] = [] _list['loki'] = [] - r = requests.get('https://api.invidious.io/instances.json') + r = requests.get(url) rJson = json.loads(r.text) for instance in rJson: if instance[1]['type'] == 'https': @@ -256,11 +257,11 @@ def piped(): def pipedMaterial(): - fetchRegexList('pipedMaterial', 'Piped-Material', 'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md', r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\|") + fetchRegexList('pipedMaterial', 'Piped-Material', 'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md', r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\| Production") def cloudtube(): - fetchCache('cloudtube', 'Cloudtube') + fetchFromFile('cloudtube', 'Cloudtube') def proxitok(): -- cgit 1.4.1 From f8a0de245dbdafeec1d8c6a7fe170e039cc120cd Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 20 Sep 2022 08:09:10 +0200 Subject: Delete gh instance fetcher. --- .github/workflows/main.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 88edbe34..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: instances-updater - -on: - schedule: - - cron: "10 22 */3 * *" - - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: get repo content - uses: actions/checkout@v2 - - - name: setup python - uses: actions/setup-python@v2 - with: - python-version: "3.8" # install the python version needed - - - name: install python packages - run: | - python -m pip install --upgrade pip - pip install requests bs4 colorama - - name: run script - run: python src/instances/get_instances.py - - - name: commit files - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "update instances" || : - - name: push changes - uses: ad-m/github-push-action@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: master -- cgit 1.4.1 From 8f05957ffad01824448397574851719f4f562e58 Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 20 Sep 2022 22:24:19 +0100 Subject: Fixed more bugs --- src/assets/javascripts/services.js | 61 ++++++++++++++++------------------- src/instances/get_instances.py | 28 ++++++++-------- src/pages/options/widgets/services.js | 6 ++-- 3 files changed, 45 insertions(+), 50 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index affe0d1a..fff32275 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -25,14 +25,12 @@ function init() { options.networkFallback = r.networkFallback options.redirects = r.redirects }) - //cur = current for (const service in config.services) { options[service] = {} browser.storage.local.get([`${utils.camelCase(service)}Enable`, `${service}RedirectType`, `${service}Frontend`], r => { options[service].enabled = r[utils.camelCase(service) + "Enable"] options[service].frontend = r[service + "Frontend"] options[service].redirectType = r[service + "RedirectType"] - // console.log(r) }) for (const frontend in config.services[service].frontends) { options[frontend] = {} @@ -40,8 +38,6 @@ function init() { options[frontend].custom = [] for (const network in config.networks) { browser.storage.local.get([`${frontend}${utils.camelCase(network)}RedirectsChecks`, `${frontend}${utils.camelCase(network)}CustomRedirects`], r => { - // console.log(r) - // console.log(`${frontend}${utils.camelCase(network)}RedirectsChecks`) options[frontend].checks = r[frontend + utils.camelCase(network) + "RedirectsChecks"] options[frontend].custom = r[frontend + utils.camelCase(network) + "CustomRedirects"] }) @@ -390,46 +386,45 @@ function initDefaults() { .then(async data => { let dataJson = JSON.parse(data) redirects = dataJson - // console.log(redirects) - // console.log(config) - browser.storage.local.set({ - redirects: redirects.invidious, - }) browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { - // console.log(r) for (const service in config.services) { if (config.services[service].targets == "datajson") { - browser.storage.local.set({ [service + "Targets"]: redirects[service] }) + browser.storage.local.set({ [service + "Targets"]: [...dataJson[service]] }) + delete redirects[service] } - for (const defaultOption in config.services[service].defaults) { - browser.storage.local.set({ [service + camelCase(defaultOption)]: config.services[service].defaults[defaultOption] }) + for (const defaultOption in config.services[service].options) { + browser.storage.local.set({ [service + utils.camelCase(defaultOption)]: config.services[service].options[defaultOption] }) } for (const frontend in config.services[service].frontends) { - let clearnetChecks = redirects[frontend].clearnet - for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { - let i = clearnetChecks.indexOf(instance) - if (i > -1) clearnetChecks.splice(i, 1) - } - for (const network in config.networks) { - // console.log(redirects[frontend][network]) - switch (network) { - case "clearnet": - browser.storage.local.set({ - [frontend + "ClearnetRedirectsChecks"]: [clearnetChecks], - [frontend + "ClearnetCustomRedirects"]: [], - }) - break - default: - browser.storage.local.set({ - [frontend + utils.camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], - [frontend + utils.camelCase(network) + "CustomRedirects"]: [], - }) + if (config.services[service].frontends[frontend].instanceList) { + let clearnetChecks = redirects[frontend].clearnet + for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList, ...r.offlineBlackList]) { + let i = clearnetChecks.indexOf(instance) + if (i > -1) clearnetChecks.splice(i, 1) + } + for (const network in config.networks) { + switch (network) { + case "clearnet": + browser.storage.local.set({ + [frontend + "ClearnetRedirectsChecks"]: [...clearnetChecks], + [frontend + "ClearnetCustomRedirects"]: [], + }) + break + default: + browser.storage.local.set({ + [frontend + utils.camelCase(network) + "RedirectsChecks"]: [...redirects[frontend][network]], + [frontend + utils.camelCase(network) + "CustomRedirects"]: [], + }) + } } } } } - ;() => resolve() }) + browser.storage.local.set({ + redirects, + }) + ;() => resolve() }) }) } diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 3dcb42b4..2547917a 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -22,7 +22,6 @@ with open('./src/config/config.json', 'rt') as tmp: config['networks'] = json.load(tmp)['config']['networks'] - def filterLastSlash(urlList): tmp = {} for x in urlList: @@ -106,7 +105,7 @@ def is_offline(url): except: return False -def fetchCache(frontend, name) : +def fetchCache(frontend, name): # json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) with open('./src/instances/data.json') as file: mightyList[frontend] = json.load(file)[frontend] @@ -125,7 +124,16 @@ def fetchJsonList(frontend, name, url, urlItem): _list = {} for network in config['networks']: _list[network] = [] - if type(urlItem) == 'str': + if type(urlItem) == dict: + for item in rJson: + for network in config['networks']: + if urlItem[network] != None: + if urlItem[network] in item: + if item[urlItem[network]].strip() != '': + _list[network].append(item[urlItem[network]]) + else: + if frontend == 'librarian': + rJson = rJson['instances'] # I got lazy :p Might fix this at some point... for item in rJson: tmpItem = item if urlItem is not None: @@ -140,14 +148,6 @@ def fetchJsonList(frontend, name, url, urlItem): _list['loki'].append(tmpItem) else: _list['clearnet'].append(tmpItem) - else: - for i in range(len(config['networks']) - 1): - # The expected order is the same as in config.json. If the frontend doesn't have any instances for a specified network, use None - if urlItem != None: - for item in rJson: - if network in item: - if item[network].strip() != '': - _list[config['networks'][i]].append(item[urlItem[i]]) mightyList[frontend] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) @@ -322,11 +322,11 @@ def libreddit(): def teddit(): - fetchJsonList('teddit', 'Teddit', 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json', ['url', 'onion', 'i2p', None]) + fetchJsonList('teddit', 'Teddit', 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json', { 'clearnet': 'url', 'tor': 'onion', 'i2p': 'i2p', 'loki': None }) def wikiless(): - fetchJsonList('wikiless', 'Wikiless', 'https://wikiless.org/instances.json', ['url', 'onion', 'i2p', None]) + fetchJsonList('wikiless', 'Wikiless', 'https://wikiless.org/instances.json', { 'clearnet': 'url', 'tor': 'onion', 'i2p': 'i2p', 'loki': None}) def scribe(): @@ -419,7 +419,7 @@ def librex(): def rimgo(): - fetchJsonList('rimgo', 'rimgo', 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json', ['url', 'onion', 'i2p', None]) + fetchJsonList('rimgo', 'rimgo', 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json', {'clearnet': 'url', 'tor': 'onion', 'i2p': 'i2p', 'loki': None}) def librarian(): diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index 4a53a749..33c174f9 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -1,7 +1,7 @@ import utils from "../../../assets/javascripts/utils.js" let config, - network, + selectedNetwork, divs = {} function getConfig() { @@ -19,7 +19,7 @@ function getConfig() { await getConfig() browser.storage.local.get("network", r => { - network = r.network + selectedNetwork = r.network }) function changeFrontendsSettings(service) { @@ -54,6 +54,7 @@ function changeNetworkSettings(selectedNetwork) { } } +changeNetworkSettings(selectedNetwork) for (const service in config.services) { divs[service] = {} divs[service][service] = document.getElementById(`${service}_page`) @@ -73,7 +74,6 @@ for (const service in config.services) { } changeFrontendsSettings(service) - changeNetworkSettings(network) for (const frontend in config.services[service].frontends) { if (config.services[service].frontends[frontend].instanceList) { -- cgit 1.4.1 From b2b9adfa97adc2d3784f5d76f670b919bb6a64fe Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 20 Sep 2022 22:27:56 +0100 Subject: Update instances to match new structure --- src/instances/blacklist.json | 58 ++++-- src/instances/data.json | 430 +++++++++++++++++++++---------------------- 2 files changed, 252 insertions(+), 236 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index e7756f8e..fe941df0 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -1,29 +1,36 @@ { "cloudflare": [ "https://invidious.kavin.rocks", + "https://invidious.rhyshl.live", "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", "https://de-piped.shimul.me", "https://pipedus.palash.dev", - "https://piped.waffle.wiki", "https://watch.whatever.social", + "https://piped.garudalinux.org", + "https://y.rivo.lol", + "https://cringe.whatever.social", "https://nitter.domain.glass", "https://birdsite.xanny.family", + "https://nitter.it", "https://notabird.site", "https://fuckthesacklers.network", "https://nitter.winscloud.net", "https://twtr.bch.bar", "https://twitter.dr460nf1r3.org", "https://nitter.garudalinux.org", - "https://nitter.wef.lol", "https://nitter.catalyst.sx", "https://nitter.fprivacy.com", - "https://bib.actionsack.com", + "https://read.whatever.social", + "https://nitter.rawbit.ninja", + "https://nitter.privacytools.io", + "https://nitter.sneed.network", + "https://n.sneed.network", + "https://nitter.twei.space", "https://libreddit.domain.glass", "https://r.nf", - "https://lr.oversold.host", "https://libreddit.hu", "https://lr.stilic.ml", "https://reddi.tk", @@ -32,6 +39,7 @@ "https://libreddit.winscloud.net", "https://r.ahwx.org", "https://reddit.dr460nf1r3.org", + "https://libreddit.mha.fi", "https://libreddit.encrypted-data.xyz", "https://libreddit.eu.org", "https://teddit.domain.glass", @@ -39,44 +47,54 @@ "https://teddit.encrypted-data.xyz", "https://teddit.garudalinux.org", "https://tedd.it", + "https://wiki.privacytools.io", + "https://teddit.rawbit.ninja", "https://wiki.604kph.xyz", + "https://wiki.privacytools.io", + "https://wikiless.rawbit.ninja", + "https://scribe.rawbit.ninja", "https://lingva.garudalinux.org", "https://translate.dr460nf1r3.org", - "https://searx.org", "https://searx.run", - "https://search.albony.xyz", + "https://searx.org", "https://search.garudalinux.org", "https://search.dr460nf1r3.org", "https://search.wef.lol", "https://i.actionsack.com", "https://rimgo.encrypted-data.xyz", - "https://beatbump.ml" + "https://beatbump.ml", + "https://listen.whatever.social" ], "authenticate": [ "https://nitter:nitter@nitter.nixnet.services" ], "offline": [ - "https://invidious.snopyta.org", - "https://tok.habedieeh.re", - "https://n.hyperborea.cloud", - "https://nitter.spaceint.fr", - "https://bibliogram.snopyta.org", - "https://libreddit.autarkic.org", + "https://invidious.rhyshl.live", + "https://proxitok.odyssey346.dev", + "https://nhanh.cloud", + "https://nitter.nl", + "https://ntr.odyssey346.dev", + "https://libreddit.nl", "https://libreddit.notyourcomputer.net", - "https://anon.sx", + "https://teddit.ggc-project.de", + "https://teddit.nautolan.racing", + "https://tedd.it", + "https://teddit.artemislena.eu", + "https://wiki.froth.zone", + "https://quetre.odyssey346.dev", + "https://st.odyssey346.dev", "https://jsearch.pw", "https://searx.gnu.style", "https://searx.semipvt.com", "https://etsi.me", - "https://s.zhaocloud.net", - "https://search.vidhukant.xyz", + "https://search.zzls.xyz", "https://searx.ericaftereric.top", "https://searx.fmac.xyz", - "https://searxng.au/searx", "https://www.webrats.xyz", - "https://search.albony.xyz", "https://whoogle.esmailelbob.xyz", - "https://beatbump.ml", - "https://stube.tokhmi.xyz" + "https://search.wef.lol", + "https://i.bcow.xyz", + "https://lbry.bcow.xyz", + "https://beatbump.ml" ] } \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index 3e82842c..e2e5d9f5 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -1,75 +1,82 @@ { "invidious": { - "normal": [ + "clearnet": [ "https://yewtu.be", "https://vid.puffyan.us", + "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", - "https://invidious.osi.kr", + "https://invidio.xamh.de", "https://y.com.sb", "https://yt.artemislena.eu", - "https://invidious.flokinet.to", "https://invidious.sethforprivacy.com", + "https://invidious.flokinet.to", "https://invidious.tiekoetter.com", "https://inv.bp.projectsegfau.lt", - "https://invidious.projectsegfau.lt", "https://inv.vern.cc", + "https://invidious.projectsegfau.lt", "https://invidious.nerdvpn.de", + "https://invidious.rhyshl.live", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://youtube.076.ne.jp", "https://invidious.weblibre.org", - "https://invidious.snopyta.org", "https://invidious.esmailelbob.xyz", + "https://youtube.076.ne.jp", "https://invidious.namazso.eu" ], "tor": [ - "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", - "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", - "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", - "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", - "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", - "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", - "http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion", + "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://invidious.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + "http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion", + "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", + "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", + "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", + "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", + "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", + "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", + "http://am74vkcrjp2d5v36lcdqgsj2m6x36tbrkhsruoegwfcizzabnfgf5zyd.onion" ], "i2p": [], "loki": [] }, "piped": { - "normal": [ + "clearnet": [ "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://il.ax", "https://piped.mha.fi", "https://de-piped.shimul.me", "https://pipedus.palash.dev", - "https://piped.waffle.wiki", "https://watch.whatever.social", + "https://piped.garudalinux.org", + "https://y.rivo.lol", "https://yt.jae.fi", "https://piped.mint.lgbt", + "https://il.ax", + "https://piped.privacy.com.de", "https://piped.esmailelbob.xyz", - "https://piped.projectsegfau.lt" + "https://piped.projectsegfau.lt", + "https://piped.privacydev.net", + "https://piped.palveluntarjoaja.eu", + "https://piped.smnz.de", + "https://piped.adminforge.de", + "https://watch.whatevertinfoil.de" ], "tor": [], "i2p": [], "loki": [] }, "pipedMaterial": { - "normal": [ + "clearnet": [ "https://piped-material.১.net", - "https://piped-material.ftp.sh", - "https://piped-staging.ftp.sh", - "https://ui.piped.১.net" + "https://piped-material.ftp.sh" ], "tor": [], "i2p": [], "loki": [] }, "cloudtube": { - "normal": [ + "clearnet": [ "https://tube.cadence.moe", "https://yt.beparanoid.de" ], @@ -80,18 +87,25 @@ "loki": [] }, "proxiTok": { - "normal": [ - "https://proxitok.herokuapp.com", + "clearnet": [ + "https://proxitok.pabloferreiro.es", "https://proxitok.pussthecat.org", + "https://tok.habedieeh.re", + "https://proxitok.esmailelbob.xyz", + "https://cringe.whatever.social", + "https://proxitok.dhusch.de", "https://proxitok.privacydev.net", - "https://tok.habedieeh.re" + "https://proxitok.odyssey346.dev", + "https://tok.artemislena.eu", + "https://tok.adminforge.de", + "https://proxitok.manasiwibi.com" ], "tor": [], "i2p": [], "loki": [] }, "send": { - "normal": [ + "clearnet": [ "https://send.vis.ee", "https://send.zcyph.cc", "https://send.turingpoint.de", @@ -115,7 +129,7 @@ "loki": [] }, "nitter": { - "normal": [ + "clearnet": [ "https://nitter.net", "https://nitter.42l.fr", "https://nitter.pussthecat.org", @@ -133,7 +147,6 @@ "https://nitter.it", "https://twitter.censors.us", "https://nitter.grimneko.de", - "https://n.hyperborea.cloud", "https://nitter.ca", "https://twitter.076.ne.jp", "https://nitter.fly.dev", @@ -148,14 +161,11 @@ "https://fuckthesacklers.network", "https://nitter.esmailelbob.xyz", "https://tw.artemislena.eu", - "https://de.nttr.stream", "https://nitter.winscloud.net", "https://nitter.tiekoetter.com", "https://nitter.spaceint.fr", "https://twtr.bch.bar", "https://nitter.privacy.com.de", - "https://nitter.mastodon.pro", - "https://nitter.notraxx.ch", "https://nitter.poast.org", "https://nitter.bird.froth.zone", "https://nitter.dcs0.hu", @@ -165,13 +175,11 @@ "https://n.ramle.be", "https://nitter.cz", "https://nitter.privacydev.net", + "https://nitter.evil.site", "https://tweet.lambda.dance", - "https://nitter.ebnar.xyz", "https://nitter.kylrth.com", "https://nitter.foss.wtf", "https://nitter.priv.pw", - "https://nt.vern.cc", - "https://nitter.wef.lol", "https://nitter.tokhmi.xyz", "https://nitter.catalyst.sx", "https://unofficialbird.com", @@ -184,7 +192,21 @@ "https://nederland.unofficialbird.com", "https://uk.unofficialbird.com", "https://n.l5.ca", - "https://nitter.slipfox.xyz" + "https://nitter.slipfox.xyz", + "https://nitter.soopy.moe", + "https://nitter.qwik.space", + "https://read.whatever.social", + "https://nitter.rawbit.ninja", + "https://nt.vern.cc", + "https://ntr.odyssey346.dev", + "https://nitter.ir", + "https://nitter.privacytools.io", + "https://nitter.sneed.network", + "https://n.sneed.network", + "https://nitter.manasiwibi.com", + "https://nitter.smnz.de", + "https://nitter.twei.space", + "https://nitter.inpt.fr" ], "tor": [ "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -197,7 +219,7 @@ "http://jebqj47jgxleaiosfcxfibx2xdahjettuydlxbg64azd4khsxv6kawid.onion", "http://nttr2iupbb6fazdpr2rgbooon2tzbbsvvkagkgkwohhodjzj43stxhad.onion", "http://nitraeju2mipeziu2wtcrqsxg7h62v5y4eqgwi75uprynkj74gevvuqd.onion", - "http://nitter.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://nitter.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://ibsboeui2im5o7dxnik3s5yghufumgy5abevtij5nbizequfpu4qi4ad.onion", "http://ec5nvbycpfa5k6ro77blxgkyrzbkv7uy6r5cngcbkadtjj2733nm3uyd.onion", "http://twitter.ap3jtgssd7qn4vfoa62gi2ijddoblslbeuw5dan3xt7myvqpura5i4qd.onion", @@ -207,39 +229,36 @@ "http://nitterqdyumlovt7tjqpdjrluitgmtpa53qq3idlpgoe4kxo7gs3xvad.onion", "http://nitter.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion", - "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion" + "http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion", + "http://qwikxx2erhx6qrymued6ox2qkf2yeogjwypqvzoif4fqkljixasr6oid.onion", + "http://4g47cxugkohbweao2x66nnxxfoe3k7gdfzxej537nhdbwr522sbjxeqd.onion", + "http://tw.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion" ], "i2p": [ "http://axd6uavsstsrvstva4mzlzh4ct76rc6zdug3nxdgeitrzczhzf4q.b32.i2p", "http://u6ikd6zndl3c4dsdq4mmujpntgeevdk5qzkfb57r4tnfeccrn2qa.b32.i2p", - "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p" + "http://gseczlzmiv23p5vhsktyd7whquq2uy3c5fgkmdohh453qp3daoua.b32.i2p", + "http://tm4rwkeysv3zz3q5yacyr4rlmca2c4etkdobfvuqzt6vsfsu4weq.b32.i2p", + "http://vernzdedoxuflrrxc4vbatbkpjh4k22ecgiqgimdiif62onhagva.b32.i2p" ], "loki": [ "http://nitter.priv.loki" ] }, "bibliogram": { - "normal": [ - "https://bibliogram.art", - "https://bibliogram.snopyta.org", - "https://bibliogram.pussthecat.org", + "clearnet": [ "https://bibliogram.1d4.us", "https://bibliogram.froth.zone", - "https://insta.trom.tf", - "https://insta.tromdienste.de", "https://ig.tokhmi.xyz", "https://ig.beparanoid.de", - "https://bibliogram.privacydev.net", - "https://bibliogram.priv.pw", - "https://ig.funami.tech", - "https://bib.actionsack.com" + "https://bibliogram.priv.pw" ], "tor": [], "i2p": [], "loki": [] }, "libreddit": { - "normal": [ + "clearnet": [ "https://libredd.it", "https://libreddit.spike.codes", "https://libreddit.dothq.co", @@ -324,7 +343,7 @@ "loki": [] }, "teddit": { - "normal": [ + "clearnet": [ "https://teddit.net", "https://teddit.ggc-project.de", "https://teddit.zaggy.nl", @@ -347,20 +366,35 @@ "https://i.opnxng.com", "https://teddit.tokhmi.xyz", "https://teddit.garudalinux.org", - "https://tedd.it" + "https://tedd.it", + "https://wiki.privacytools.io", + "https://td.vern.cc", + "https://teddit.rawbit.ninja", + "https://teddit.artemislena.eu", + "https://teddit.manasiwibi.com" ], "tor": [ "http://snoo.ioensistjs7wd746zluwixvojbbkxhr37lepdvwtdfeav673o64iflqd.onion", "http://ibarajztopxnuhabfu7fg6gbudynxofbnmvis3ltj6lfx47b6fhrd5qd.onion", "http://tedditfyn6idalzso5wam5qd3kdtxoljjhbrbbx34q2xkcisvshuytad.onion", "http://dawtyi5e2cfyfmoht4izmczi42aa2zwh6wi34zwvc6rzf2acpxhrcrad.onion", - "http://qtpvyiaqhmwccxwzsqubd23xhmmrt75tdyw35kp43w4hvamsgl3x27ad.onion" + "http://qtpvyiaqhmwccxwzsqubd23xhmmrt75tdyw35kp43w4hvamsgl3x27ad.onion", + "http://jnuonmf2n36sfdmyksqqqyab3w63cq4kx24olyjleh5z6zzfvyt7uqqd.onion", + "http://td.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://yqu4yj5lju7bmlwpzpmltb5gsu6cw7nnbcxxx4iqemwa56nxjiggf4qd.onion", + "http://teddit.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion", + "http://24fympskbrdgbf4afuvhqwwl2tv3y2vwxg5t2ktozd4j5b3fob5ntzyd.onion" + ], + "i2p": [ + "http://xugoqcf2pftm76vbznx4xuhrzyb5b6zwpizpnw2hysexjdn5l2tq.b32.i2p", + "http://teddit.i2p", + "https://codeberg.org/teddit/teddit/src/branch/main/vzeiwzi7ogwl3ijrfek4fbtwhvamxcpyqoc3s4vcgnhlp54s5clq.b32.i2p", + "http://verncco2oaxjikammz4pi7umzp673cme6zuemx7yeeewspwrw3va.b32.i2p" ], - "i2p": [], "loki": [] }, "wikiless": { - "normal": [ + "clearnet": [ "https://wikiless.org", "https://wikiless.sethforprivacy.com", "https://wiki.604kph.xyz", @@ -370,69 +404,85 @@ "https://wikiless.tiekoetter.com", "https://wikiless.esmailelbob.xyz", "https://wiki.slipfox.xyz", - "https://wikiless.funami.tech" + "https://wikiless.funami.tech", + "https://wl.vern.cc", + "https://wiki.privacytools.io", + "https://wikiless.rawbit.ninja", + "https://wiki.adminforge.de" ], "tor": [ "http://dj2tbh2nqfxyfmvq33cjmhuw7nb6am7thzd3zsjvizeqf374fixbrxyd.onion", "http://ybgg2evrcdz37y2qes23ff3wjqjdn33tthgoagi76vhxytu4mpxiz5qd.onion", - "http://wikiless.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion" + "http://wikiless.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", + "http://c2pesewpalbi6lbfc5hf53q4g3ovnxe4s7tfa6k2aqkf7jd7a7dlz5ad.onion", + "http://wl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", + "http://tdx37ew3oke5rxn3yi5r5665ka7ozvehnd4xmnjxxdvqorias2nyl4qd.onion" ], "i2p": [ "http://wikiless.i2p", "http://hflqp2ejxygpj6cdwo3ogfieqmxw3b56w7dblt7bor2ltwk6kcfa.b32.i2p", - "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p" + "http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p", + "http://vernesciy2defjsputrjrv6pa5ll6qzrckfffi5lgkumstdojyga.b32.i2p" ], "loki": [] }, "scribe": { - "normal": [ + "clearnet": [ "https://scribe.rip", "https://scribe.nixnet.services", "https://scribe.citizen4.eu", "https://scribe.bus-hit.me", "https://scribe.froth.zone", - "https://scribe.esmailelbob.xyz" + "https://scribe.esmailelbob.xyz", + "https://scribe.privacydev.net", + "https://scribe.rawbit.ninja", + "https://sc.vern.cc" ], "tor": [], "i2p": [], "loki": [] }, "quetre": { - "normal": [ - "https://quetre.herokuapp.com", - "https://quora.vern.cc", + "clearnet": [ + "https://quetre.iket.me", + "https://qr.vern.cc", "https://quetre.pussthecat.org", "https://wuetre.herokuapp.com", "https://quetreus.herokuapp.com", "https://quetre.tokhmi.xyz", "https://quetre.projectsegfau.lt", - "https://quetre.esmailelbob.xyz" + "https://quetre.esmailelbob.xyz", + "https://quetre.odyssey346.dev" + ], + "tor": [ + "http://quetre.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", + "http://qr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" ], - "tor": [], "i2p": [], "loki": [] }, "libremdb": { - "normal": [ + "clearnet": [ "https://libremdb.herokuapp.com", "https://libremdb.pussthecat.org", "https://libremdbeu.herokuapp.com", "https://lmdb.tokhmi.xyz", "https://libremdb.esmailelbob.xyz" ], - "tor": [], + "tor": [ + "http://libremdb.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" + ], "i2p": [], "loki": [] }, "simplyTranslate": { - "normal": [ + "clearnet": [ "https://simplytranslate.org", "https://st.tokhmi.xyz", "https://translate.josias.dev", "https://translate.namazso.eu", "https://translate.riverside.rocks", - "https://st.manerakai.com", + "https://simplytranslate.manerakai.com", "https://translate.bus-hit.me", "https://simplytranslate.pussthecat.org", "https://translate.northboot.xyz", @@ -442,22 +492,26 @@ "https://translate.slipfox.xyz", "https://st.privacydev.net", "https://translate.beparanoid.de", - "https://translate.priv.pw" + "https://translate.priv.pw", + "https://st.odyssey346.dev" ], "tor": [ "http://fyng2tsmzmvxmojzbbwmfnsn2lrcyftf4cw6rk5j2v2huliazud3fjid.onion", "http://xxtbwyb5z5bdvy2f6l2yquu5qilgkjeewno4qfknvb3lkg3nmoklitid.onion", - "http://translate.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion" + "http://translate.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", + "http://simplytranslate.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", + "http://tl.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" ], "i2p": [ - "http://kmnkkp4v4ublygtnyq46oacy3qw75nrxxniriuaersumw7bfsm2a.b32.i2p" + "http://kmnkkp4v4ublygtnyq46oacy3qw75nrxxniriuaersumw7bfsm2a.b32.i2p", + "http://verna7avzgd4qqal7k2onjzwxcceqby2gwvya2a2frdswb7z2k4q.b32.i2p" ], "loki": [ "http://translate.priv.loki" ] }, "lingva": { - "normal": [ + "clearnet": [ "https://lingva.ml", "https://translate.igna.ooo", "https://lingva.pussthecat.org", @@ -473,8 +527,7 @@ "loki": [] }, "searx": { - "normal": [ - "https://anon.sx", + "clearnet": [ "https://dynabyte.ca", "https://jsearch.pw", "https://search.ethibox.fr", @@ -491,8 +544,6 @@ "https://searx.nakhan.net", "https://searx.netzspielplatz.de", "https://searx.nixnet.services", - "https://searx.org", - "https://searx.rasp.fr", "https://searx.ru", "https://searx.run", "https://searx.semipvt.com", @@ -515,10 +566,12 @@ ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", + "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", - "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion" + "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion" ], "i2p": [ "http://ransack.i2p", @@ -527,12 +580,15 @@ "loki": [] }, "searxng": { - "normal": [ + "clearnet": [ "https://darmarit.org/searx", "https://de.xcxc.ml", "https://etsi.me", + "https://icanfindit.online", "https://jackgoss.xyz", + "https://metasearch.nl", "https://northboot.xyz", + "https://notsearch.uk", "https://opnxng.com", "https://paulgo.io", "https://priv.au", @@ -542,24 +598,30 @@ "https://saber.tk", "https://search.0relay.com", "https://search.affusio.com", - "https://search.ashs.club", - "https://search.bingowaves.xyz", "https://search.bus-hit.me", "https://search.chemicals-in-the-water.eu", + "https://search.cronobox.one", "https://search.disroot.org", "https://search.gcomm.ch", "https://search.kiwitalk.de", "https://search.mdosch.de", + "https://search.mpx.wtf", "https://search.neet.works", "https://search.ononoki.org", "https://search.privacyguides.net", "https://search.projectsegfau.lt", "https://search.rabbit-company.com", + "https://search.rhscze.cf", + "https://search.rowie.at", "https://search.sapti.me", + "https://search.serginho.dev", + "https://search.smnz.de", "https://search.teamriverbubbles.com", "https://search.unlocked.link", + "https://search.uspersec.com", "https://search.vidhukant.xyz", "https://search.zzls.xyz", + "https://searx.baczek.me", "https://searx.be", "https://searx.becomesovran.com", "https://searx.chocoflan.net", @@ -569,9 +631,11 @@ "https://searx.fi", "https://searx.fmac.xyz", "https://searx.gnous.eu", + "https://searx.kujonello.cf", "https://searx.mha.fi", "https://searx.mistli.net", "https://searx.namejeff.xyz", + "https://searx.org", "https://searx.orion-hub.fr", "https://searx.priv.pw", "https://searx.prvcy.eu", @@ -580,40 +644,41 @@ "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", "https://searx.tiekoetter.com", - "https://searx.vimproved.me", "https://searx.zcyph.cc", - "https://searxng.au/searx", - "https://searxng.tordenskjold.de", + "https://searxng.nicfab.it", "https://searxng.zackptg5.com", "https://serx.ml", "https://sh0.it", + "https://soek.allesbeste.com", "https://srx.cosmohub.io", "https://swag.pw", + "https://trydex.tk/searxng", "https://www.gruble.de", "https://www.webrats.xyz", - "https://xcxc.ml", "https://xo.wtf" ], "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", - "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", + "http://privateoz3u5utrimal2edr56j3r5caakektxxgixigdkycuxigvquid.onion", "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", - "http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion", - "http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion", + "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", + "http://b2c7fvbhnfvwnl6oh2tydhzfx4i37kmmrycq42heqbbe7wovq3uzenid.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", + "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", - "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion" + "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion", + "https://lgmekfnpealdqhnctyg3p5fuelpdwnbqbwnl2ickpdoodzatzgz27ryd.onion" ], "i2p": [], "loki": [] }, "whoogle": { - "normal": [ + "clearnet": [ "https://gowogle.voring.me", "https://s.tokhmi.xyz", "https://search.albony.xyz", @@ -633,29 +698,32 @@ "loki": [] }, "librex": { - "normal": [ + "clearnet": [ "https://librex.beparanoid.de", + "https://librex.extravi.dev", "https://search.davidovski.xyz", "https://search.funami.tech", - "https://librex.catalyst.sx" + "https://librex.catalyst.sx", + "https://search.madreyk.xyz", + "https://search.pabloferreiro.es" ], "tor": [ - "http://librex.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", + "http://librex.2356uhnbpv5nk3bni5bv6jg2cd6lgj664kwx3lhyelstpttpyv4kk2qd.onion", + "http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion", "http://librex.so2mpiyfo4cje7bof5v52y3cvjyo2haxpqfvut4sr6gj2ul4mddx2jid.onion" ], "i2p": [ - "http://fboseyskrqpi6yjiifvz4ryuoiswjezkqsfxfkm2vmbuhehbpr7q.b32.i2p" + "http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p" ], "loki": [] }, "rimgo": { - "normal": [ + "clearnet": [ "https://i.bcow.xyz", "https://rimgo.pussthecat.org", "https://rimgo.totaldarkness.net", "https://rimgo.bus-hit.me", "https://rimgo.esmailelbob.xyz", - "https://rimgo.lunar.icu", "https://i.actionsack.com", "https://rimgo.privacydev.net", "https://imgur.artemislena.eu", @@ -664,7 +732,7 @@ "https://rimgo.mha.fi" ], "tor": [ - "http://rimgo.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://rimgo.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://rimgo.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], @@ -672,25 +740,30 @@ "loki": [] }, "librarian": { - "normal": [ + "clearnet": [ "https://lbry.bcow.xyz", "https://odysee.076.ne.jp", "https://librarian.pussthecat.org", - "https://lbry.mutahar.rocks", + "https://lbry.projectsegfau.lt", "https://librarian.esmailelbob.xyz", "https://lbry.vern.cc", - "https://lbry.slipfox.xyz" + "https://lbry.slipfox.xyz", + "https://lbry.sytes.net", + "https://lbry.webhop.me", + "https://lbry.mywire.org" ], "tor": [ - "http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", + "http://librarian.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", - "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion" + "http://5znbzx2xcymhddzekfjib3isgqq4ilcyxa2bsq6vqmnvbtgu4f776lqd.onion", + "http://zjmls4urccc5wxc64ilbv4oqarjab6pbanvmhd2qqt6p7fgqrjjnryqd.onion", + "http://bxewpsswttslepw27w2hhxhlizwm7l7y54x3jw5cfrb64hb6lgc557ad.onion" ], "i2p": [], "loki": [] }, "neuters": { - "normal": [ + "clearnet": [ "https://neuters.de" ], "tor": [], @@ -698,24 +771,31 @@ "loki": [] }, "beatbump": { - "normal": [ - "https://beatbump.ml" + "clearnet": [ + "https://beatbump.ml", + "https://beatbump.esmailelbob.xyz" + ], + "tor": [ + "http://beatbump.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion" ], - "tor": [], "i2p": [], "loki": [] }, "hyperpipe": { - "normal": [ + "clearnet": [ "https://hyperpipe.surge.sh", - "https://hyperpipe.esmailelbob.xyz" + "https://hyperpipe.esmailelbob.xyz", + "https://listen.whatever.social", + "https://music.adminforge.de" + ], + "tor": [ + "http://hyperpipe.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion" ], - "tor": [], "i2p": [], "loki": [] }, "facil": { - "normal": [ + "clearnet": [ "https://facilmap.org" ], "tor": [], @@ -723,42 +803,51 @@ "loki": [] }, "simpleertube": { - "normal": [ + "clearnet": [ "https://tube.simple-web.org", "https://simpleertube.esmailelbob.xyz", - "https://stube.tokhmi.xyz" + "https://stube.tokhmi.xyz", + "https://st.vern.cc" ], "tor": [], "i2p": [], "loki": [] }, "peertube": [ + "https://pt.freedomwolf.cc", + "https://vr360tube.online", + "https://bodavr.com", + "https://peertube.tni-hosted.nl", + "https://videos.parleur.net", + "https://tube.azadehafzar.ir", + "https://pewflix.com", + "https://video.electronicping.net", + "https://videos.im.allmendenetz.de", + "https://tube.cyberia.club", + "https://casstream.nohost.me", + "https://peertube.as62430.net", + "https://peertube.askan.info", + "https://apertatube.net", + "https://beetoons.tv", + "https://rankett.net", + "https://tube.xsoftware.it", + "https://video.ut0pia.org", + "https://kinotu.be", "https://tube.nogafa.org", "https://www.neptube.io", "https://tube.ghk-academy.info", "https://pcbu.nl", - "https://soberania.tv", "https://pire.artisanlogiciel.net", - "https://trutube.xyz", "https://tube-test.apps.education.fr", "https://tube-sciences-technologies.apps.education.fr", - "https://stream.conesphere.cloud", "https://tube-institutionnel.apps.education.fr", "https://trutube.online", "https://tube-cycle-3.apps.education.fr", "https://video.manicphase.me", - "https://tube.emy.plus", - "https://v.bearvideo.win", "https://tubulus.openlatin.org", - "https://peertube.securetown.top", - "https://tv.datamol.org", "https://video.graine-pdl.org", - "https://tube.zee.li", "https://tube-cycle-2.apps.education.fr", - "https://mikeclips.net", - "https://tube.s1gm4.eu", "https://videos.keyedlimepie.org", - "https://video.cpn.so", "https://video.davduf.net", "https://tube.oldkid.digital", "https://tube.fofoca.eu", @@ -769,9 +858,6 @@ "https://media.theplattform.net", "https://peertube.offerman.com", "https://v.lastorder.xyz", - "https://video.eradicatinglove.xyz", - "https://peertube.thele.me", - "https://video.schnitzler.one", "https://tube.cybershock.life", "https://tube.reseau-canope.fr", "https://frentube.myyouniverse.observer", @@ -781,17 +867,12 @@ "https://video.trankil.info", "https://video.uriopss-pdl.fr", "https://pt.bolapara.mywire.org", - "https://ptube.ranranhome.info", - "https://vidid.pl", "https://video.3cmr.fr", - "https://tube.die-rote-front.de", "https://peertube.miguelcr.me", "https://video.thinkof.name", "https://nekofans.tv", "https://video.comun.al", - "https://peertube.nrsk.no", "https://video.occm.cc", - "https://peertube.viviers-fibre.net", "https://tube-action-educative.apps.education.fr", "https://jahve.pl", "https://videos.yesil.club", @@ -800,93 +881,68 @@ "https://tube.hunterjozwiak.com", "https://tube-numerique-educatif.apps.education.fr", "https://tube.itsg.host", - "https://tube.valinor.fr", "https://lucarne.balsamine.be", "https://peertube.suranyami.com", "https://video.ados.accoord.fr", "https://t.0x0.st", "https://tube-education-physique-et-sportive.apps.education.fr", "https://videos.lemouvementassociatif-pdl.org", - "https://videos.casually.cat", "https://playroom.kitsunes.world", "https://tube2.nous.media", - "https://peertube.freenet.ru", "https://peertube.0x5e.eu", "https://tube.darknight-coffee.org", "https://play.mittdata.se", - "https://peertube.lhc.net.br", - "https://see.vtopia.live", "https://peertube.letoine.fr", "https://tube-enseignement-professionnel.apps.education.fr", - "https://socpeertube.ru", "https://videos.laliguepaysdelaloire.org", "https://quantube.win", "https://twctube.twc-zone.eu", "https://vhs.absturztau.be", - "https://video.espr.moe", "https://peertube.social.my-wan.de", "https://phijkchu.com", "https://video.lycee-experimental.org", - "https://galileo.news", - "https://peertube.otakufarms.com", "https://tube.motuhake.xyz", "https://pt.m0r016.net", "https://hitchtube.fr", "https://video.fox-romka.ru", "https://peertube.ctrl-c.liu.se", - "https://peertube.live", "https://video.slipfox.xyz", - "https://pt.vern.cc", "https://vnop.org", "https://videos.cassidypunchmachine.com", - "https://tv1.gomntu.space", "https://dalek.zone", "https://seka.pona.la", "https://syop.tv", "https://watch.thelema.social", "https://tube.miegl.cz", "https://mov.clov.fr", - "https://videomensoif.ynh.fr", - "https://videos.neongarden.life", "https://video.vaku.org.ua", "https://videos.trom.lt", "https://vid.mkp.ca", "https://jupiter.tube", - "https://tuvideo.encanarias.info", "https://videos.squat.net", "https://peertube.chaunchy.com", "https://tube.vrpnet.org", "https://video.tii.space", - "https://peertube.inubo.ch", "https://nightshift.minnix.dev", "https://tube.friloux.me", "https://peertube.virtual-assembly.org", - "https://video.olos311.org", "https://peertube.atilla.org", - "https://video.lapineige.fr", - "https://zapping.no-ip.info", "https://tube.azkware.net", "https://video.lunasqu.ee", "https://v.mkp.ca", "https://peertube.eus", "https://infothema.net", "https://tube.nilsu.org", - "https://podlibre.video", - "https://videos.tankernn.eu", "https://watch.autonomous-zone.earth", "https://pirtube.calut.fr", "https://y.melonia.se", - "https://peertube.cirkau.art", - "https://peertube.2i2l.net", "https://videos.martyn.berlin", "https://turkum.me", "https://video.colibris-outilslibres.org", - "https://invoice.peertube.biz", "https://peertube.chantierlibre.org", "https://video.9wd.eu", "https://video.niboe.info", "https://peertuibe.fedsinfo.nohost.me", - "https://s9.gegenstimme.tv", "https://videos.alamaisondulibre.org", "https://videos.tormentasolar.win", "https://tube.nestor.coop", @@ -903,13 +959,9 @@ "https://peertube.bgzashtita.es", "https://tube.genb.de", "https://cliptube.org", - "https://tube.tr4sk.me", "https://videos.campdarling.com", - "https://video.mikka.md", - "https://www.aktion-nordost.tv", "https://tube.rooty.fr", "https://tube.dnet.one", - "https://peertube.io", "https://www.kotikoff.net", "https://peertube.nz", "https://videos.grafo.zone", @@ -921,7 +973,6 @@ "https://peertube.narrativerry.xyz", "https://tube.9minuti.it", "https://krdtube.org", - "https://peertube.elforcer.ru", "https://tubocatodico.bida.im", "https://torstenwitte.peertube-host.de", "https://peertube.hackerfraternity.org", @@ -940,14 +991,9 @@ "https://free-streams.com", "https://tube.pawelko.net", "https://video.livecchi.cloud", - "https://anarchy.video", "https://peertube.gsugambit.com", - "https://media.zat.im", - "https://videos.sadx.moe", "https://pt.nospy.net", "https://yhwh.tube", - "https://peerlook.ru", - "https://monero.wf", "https://tube.kicou.info", "https://video.aqr.af", "https://videos-passages.huma-num.fr", @@ -956,8 +1002,6 @@ "https://peertube.dsmouse.net", "https://ptube.horsentiers.fr", "https://video.cnt.social", - "https://peertube.okko.io", - "https://video.mentality.rip", "https://tube.03281.fspfc.org", "https://tube.linc.systems", "https://peertube.ketchup.noho.st", @@ -970,31 +1014,23 @@ "https://truvitv.com", "https://pt.ilyamikcoder.com", "https://peertube.sensin.eu", - "https://watch.riverside.rocks", - "https://sharetube.us", "https://video.sadmin.io", "https://stream.jurnalfm.md", - "https://video.asgardius.company", "https://video.publicspaces.net", "https://video.eientei.org", "https://tv.suwerenni.org", "https://tube.revertron.com", "https://tube.erzbistum-hamburg.de", - "https://video.germanische-heilkunde.at", "https://views.southfox.me", - "https://vide.oxel.me", "https://video.mttv.it", "https://peertube.cloud.nerdraum.de", "https://vid.pretok.tv", "https://videos.slownewsdayshow.com", "https://videos.sarcasmstardust.com", "https://videos.factsonthegroundshow.com", - "https://video.pe6.eu", "https://tv.santic-zombie.ru", "https://tube.sleeping.town", - "https://tube.globalfrens.com", "https://peertube.hacknews.pmdcollab.org", - "https://freetubes.nohost.me", "https://video.snug.moe", "https://video.avant-le-strike.buzz", "https://videos.ritimo.org", @@ -1017,17 +1053,14 @@ "https://peertube.beardedtek.com", "https://creemoseducacioninclusiva.uma.es", "https://videos.yeswiki.net", - "https://tube.lrk.sh", "https://peertube.autogestioncitoyenne.org", "https://video.r3s.nrw", "https://peertube.semweb.pro", "https://poast.tv", "https://testube.distrilab.fr", "https://peertube.rse43.com", - "https://libremedia.video", "https://vid.lelux.fi", "https://v.wolfskaempf.de", - "https://peertube.chevro.fr", "https://media.econoalchemist.com", "https://video.qoto.org", "https://peertube.maxweiss.io", @@ -1036,34 +1069,27 @@ "https://peertube.swarm.solvingmaz.es", "https://film.node9.org", "https://peertube.mi-site.net", - "https://tube.nowtech.io", "https://raptube.antipub.org", "https://video.cm-en-transition.fr", "https://tube.koweb.fr", "https://peertube.genma.fr", "https://tv.generallyrubbish.net.au", - "https://video.travisshears.xyz", "https://videos.codingotaku.com", "https://foss.tube", "https://peertube.satoshishop.de", "https://ua.peertube.red", "https://peertube.zwindler.fr", "https://videos.fsci.in", - "https://swebbtube.se", "https://video.dnfi.no", "https://peertube.revelin.fr", - "https://armstube.com", "https://peertube.ti-fr.com", "https://video.turbo.chat", - "https://tube.toldi.eu", - "https://review.peertube.biz", "https://peertube.am-networks.fr", "https://video.chbmeyer.de", "https://video.rs-einrich.de", "https://p2ptv.ru", "https://peertube.librenet.co.za", "https://h3h3.club", - "https://watch.snoot.tube", "https://tube.freepeople.fr", "https://watch.rt4mn.org", "https://video.lrose.de", @@ -1080,7 +1106,6 @@ "https://video.anartist.org", "https://peertube.home.x0r.fr", "https://peertube.marud.fr", - "https://freetubehub.live", "https://mtube.mooo.com", "https://skeptube.fr", "https://tube.villejuif.fr", @@ -1125,9 +1150,7 @@ "https://live.solari.com", "https://live.codinglab.ch", "https://dud-video.inf.tu-dresden.de", - "https://media-test.interior.edu.uy", "https://media.interior.edu.uy", - "https://phoenixproject.group", "https://peertube.sebu77.com", "https://www.orion-hub.fr", "https://tv.orion-serv.fr", @@ -1168,7 +1191,6 @@ "https://tube.nuxnik.com", "https://tube.froth.zone", "https://peertube.ethibox.fr", - "https://www.freetubehub.live", "https://tube.communia.org", "https://peertube.dragonborn.app", "https://ai-tube.ch", @@ -1180,14 +1202,12 @@ "https://pocketnetpeertube10.nohost.me", "https://tube.io18.top", "https://peertube.remerge.net", - "https://video.wuatek.is", "https://tube.geekyboo.net", "https://notretube.asselma.eu", "https://canal.facil.services", "https://pt.gordons.gen.nz", "https://tube.misterbanal.net", "https://peertube.fomin.site", - "https://peertube.kenjiyon.xyz", "https://tube.g1zm0.de", "https://video.ellijaymakerspace.org", "https://videos.benpro.fr", @@ -1223,14 +1243,12 @@ "https://bideoak.argia.eus", "https://video.hainry.fr", "https://video.gresille.org", - "https://peertube.tangentfox.com", "https://puffy.tube", "https://tube.kher.nl", "https://watch.ocaml.org", "https://peertube.kleph.eu", "https://tube.missbanal.net", "https://pityu.flaki.hu", - "https://tv.catalpafestival.fr", "https://pony.tube", "https://peertube.umeahackerspace.se", "https://tube.okcinfo.news", @@ -1250,7 +1268,6 @@ "https://peertube.scyldings.com", "https://gade.o-k-i.net", "https://peertube.mobilsicher.de", - "https://video.jigmedatse.com", "https://video.amiga-ng.org", "https://peertube.espace.si", "https://videos.supertuxkart.net", @@ -1264,7 +1281,6 @@ "https://peertube.w.utnw.de", "https://tube.sp-codes.de", "https://tube.apolut.net", - "https://tube.mfraters.net", "https://tube.pyngu.com", "https://peertube.troback.com", "https://peertube.ucy.de", @@ -1300,7 +1316,6 @@ "https://video.gyt.is", "https://peertube.jensdiemer.de", "https://tube.futuretic.fr", - "https://libra.syntazia.org", "https://peertube.beeldengeluid.nl", "https://tv.lumbung.space", "https://peertube.cuatrolibertades.org", @@ -1318,7 +1333,6 @@ "https://peertube.radres.xyz", "https://darkvapor.nohost.me", "https://tube.chaoszone.tv", - "https://media.over-world.org", "https://tube.avensio.de", "https://peertube.klaewyss.fr", "https://sender-fm.veezee.tube", @@ -1332,7 +1346,6 @@ "https://peertube.iriseden.eu", "https://video.shitposter.club", "https://tv.mattchristiansenmedia.com", - "https://tube.hackerscop.org", "https://peertube.kx.studio", "https://videos.3d-wolf.com", "https://tube.octaplex.net", @@ -1355,7 +1368,6 @@ "https://tube.frischesicht.de", "https://peertube1.zeteo.me", "https://conspiracydistillery.com", - "https://peertube.chemnitz.freifunk.net", "https://hpstube.fr", "https://video.blast-info.fr", "https://peertube.bubuit.net", @@ -1380,7 +1392,6 @@ "https://peertube.inapurna.org", "https://watch.libertaria.space", "https://video.triplea.fr", - "https://video.catgirl.biz", "https://vulgarisation-informatique.fr", "https://tube.kotur.org", "https://peertube.euskarabildua.eus", @@ -1430,7 +1441,6 @@ "https://evangelisch.video", "https://tube.anufrij.de", "https://videos.mastodont.cat", - "https://video.taboulisme.com", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", "https://peertube.nicolastissot.fr", @@ -1504,11 +1514,9 @@ "https://video.csc49.fr", "https://tube.wolfe.casa", "https://video.dresden.network", - "https://peertube.zapashcanon.fr", "https://40two.tube", "https://tube.amic37.fr", "https://video.comptoir.net", - "https://kino.schuerz.at", "https://peertube.tiennot.net", "https://tututu.tube", "https://tube.picasoft.net", @@ -1521,14 +1529,12 @@ "https://videos.testimonia.org", "https://video.mass-trespass.uk", "https://peertube.cipherbliss.com", - "https://peertube.stemy.me", "https://daschauher.aksel.rocks", "https://tube.cyano.at", "https://tube.nox-rhea.org", "https://peertube.securitymadein.lu", "https://tube.rita.moe", "https://tuktube.com", - "https://v.basspistol.org", "https://mytube.kn-cloud.de", "https://tube.nuagelibre.fr", "https://video.nogafam.es", @@ -1547,9 +1553,7 @@ "https://cinema.yunohost.support", "https://peertube.s2s.video", "https://peertube.travelpandas.eu", - "https://video.sdm-tools.net", "https://peertube.anzui.dev", - "https://video.up.edu.ph", "https://video.igem.org", "https://worldofvids.com", "https://peertube.underworld.fr", @@ -1576,8 +1580,6 @@ "https://video.violoncello.ch", "https://peertube.gidikroon.eu", "https://tubedu.org", - "https://watch.breadtube.tv", - "https://video.exodus-privacy.eu.org", "https://tilvids.com", "https://peertube.devloprog.org", "https://peertube.designersethiques.org", @@ -1614,11 +1616,9 @@ "https://peertube.netzbegruenung.de", "https://plextube.nl", "https://tube.opportunis.me", - "https://nanawel-peertube.dyndns.org", "https://tube-strasbourg.beta.education.fr", "https://tube.graz.social", "https://tube-besancon.beta.education.fr", - "https://vid.garwood.io", "https://kolektiva.media", "https://peertube.ichigo.everydayimshuflin.com", "https://video.lundi.am", @@ -1643,7 +1643,6 @@ "https://mplayer.demouliere.eu", "https://video.liberta.vip", "https://peertube.gcfamily.fr", - "https://video.ploud.fr", "https://tube.plaf.fr", "https://tube.nah.re", "https://dreiecksnebel.alex-detsch.de", @@ -1731,7 +1730,6 @@ "https://peertube.makotoworkshop.org", "https://peertube.serveur.slv-valbonne.fr", "https://video.netsyms.com", - "https://video.writeas.org", "https://videos.adhocmusic.com", "https://vid.y-y.li", "https://diode.zone", @@ -1775,4 +1773,4 @@ "https://peertube2.cpy.re", "https://peertube.cpy.re" ] -} \ No newline at end of file +} -- cgit 1.4.1 From d86fecab3f3e98a87d6e8af8879c036f9da44779 Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 21 Sep 2022 20:38:30 +0100 Subject: 100% compat with widgets/.js --- src/assets/javascripts/services.js | 2 +- src/config/config.json | 2 +- src/pages/options/index.html | 134 +++++++++++++++++++++++++++------ src/pages/options/widgets/general.ejs | 10 +-- src/pages/options/widgets/general.js | 24 +++--- src/pages/options/widgets/services.ejs | 20 +++-- src/pages/options/widgets/services.js | 71 +++++++++++------ 7 files changed, 188 insertions(+), 75 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index fff32275..79444442 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -385,7 +385,7 @@ function initDefaults() { .then(response => response.text()) .then(async data => { let dataJson = JSON.parse(data) - redirects = dataJson + redirects = dataJson.slice() browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { for (const service in config.services) { if (config.services[service].targets == "datajson") { diff --git a/src/config/config.json b/src/config/config.json index d0bf7edd..ac393f18 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -180,7 +180,7 @@ "setEndpoint": "/applysettings" }, "name": "Bibliogram", - "instanceList": false + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], diff --git a/src/pages/options/index.html b/src/pages/options/index.html index df6bec2a..e1163e99 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -46,8 +46,8 @@
-

- @@ -55,10 +55,10 @@
-
+
-

Fallback to normal if no instances are available for the current protocol

- +

Fallback to normal if no instances are available for the current network

+
@@ -254,15 +254,13 @@
-
-

Embed Frontend

- -
+

Embed Frontend

+

Redirect Type

@@ -998,7 +996,103 @@

- +
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ +
+
@@ -2095,14 +2189,12 @@
-
-

Embed Frontend

- -
+

Embed Frontend

+

Redirect Type

diff --git a/src/pages/options/widgets/general.ejs b/src/pages/options/widgets/general.ejs index d68a2280..e306ba4b 100644 --- a/src/pages/options/widgets/general.ejs +++ b/src/pages/options/widgets/general.ejs @@ -12,17 +12,17 @@
-

- <% for (const network in config.networks) { -%> <% }; %>
-
+
-

Fallback to normal if no instances are available for the current protocol

- +

Fallback to normal if no instances are available for the current network

+
diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index e573b4ee..9dac9bfd 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -86,15 +86,15 @@ themeElement.addEventListener("change", event => { location.reload() }) -let protocolElement = document.getElementById("protocol") -protocolElement.addEventListener("change", event => { - const value = event.target.options[protocol.selectedIndex].value +let networkElement = document.getElementById("network") +networkElement.addEventListener("change", event => { + const value = event.target.options[network.selectedIndex].value browser.storage.local.set({ network: value }) location.reload() }) -let protocolFallbackCheckbox = document.getElementById("protocol-fallback-checkbox") -protocolFallbackCheckbox.addEventListener("change", event => { +let networkFallbackCheckbox = document.getElementById("network-fallback-checkbox") +networkFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ networkFallback: event.target.checked }) }) @@ -138,16 +138,16 @@ browser.storage.local.get( r => { autoRedirectElement.checked = r.autoRedirect themeElement.value = r.theme - protocolElement.value = r.network - protocolFallbackCheckbox.checked = r.networkFallback + networkElement.value = r.network + networkFallbackCheckbox.checked = r.networkFallback latencyOutput.value = r.latencyThreshold // firstPartyIsolate.checked = r.firstPartyIsolate; - let protocolFallbackElement = document.getElementById("protocol-fallback") - if (protocolElement.value == "clearnet") { - protocolFallbackElement.style.display = "none" + let networkFallbackElement = document.getElementById("network-fallback") + if (networkElement.value == "clearnet") { + networkFallbackElement.style.display = "none" } else { - protocolFallbackElement.style.display = "block" + networkFallbackElement.style.display = "block" } instanceTypeElement.addEventListener("change", event => { @@ -200,7 +200,7 @@ browser.storage.local.get( if (instanceType == "url") { if (nameCustomInstanceInput.validity.valid) { let url = new URL(nameCustomInstanceInput.value) - val = `${url.protocol}//${url.host}` + val = `${url.network}//${url.host}` if (!exceptionsCustomInstances.url.includes(val)) exceptionsCustomInstances.url.push(val) } } else if (instanceType == "regex") { diff --git a/src/pages/options/widgets/services.ejs b/src/pages/options/widgets/services.ejs index bc75f288..44c6a9f3 100644 --- a/src/pages/options/widgets/services.ejs +++ b/src/pages/options/widgets/services.ejs @@ -18,17 +18,15 @@
<% if (config.services[service].embeddable) { _%> -
-
-

Embed Frontend

- -
+
+

Embed Frontend

+
<% } _%> <% } _%> diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index 33c174f9..69840de4 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -16,19 +16,22 @@ function getConfig() { }) } -await getConfig() +function getNetwork() { + return new Promise(resolve => { + browser.storage.local.get("network", r => { + selectedNetwork = r.network + resolve() + }) + }) +} -browser.storage.local.get("network", r => { - selectedNetwork = r.network -}) +await getConfig() +await getNetwork() function changeFrontendsSettings(service) { for (const frontend in config.services[service].frontends) { - if (config.services[service].frontends[frontend].instanceList && config.services[service].frontends.length > 1) { + if (config.services[service].frontends[frontend].instanceList) { const frontendDiv = document.getElementById(frontend) - if (divs[service].frontend == null) { - console.log(frontend) - } if (frontend == divs[service].frontend.value) { frontendDiv.style.display = "block" } else { @@ -36,25 +39,43 @@ function changeFrontendsSettings(service) { } } } + + if (config.services[service].embeddable) { + if (!config.services[service].frontends[divs[service].frontend.value].instanceList) { + divs[service].embedFrontend.disabled = false + for (const frontend in config.services[service].frontends) { + if (config.services[service].frontends[frontend].embeddable) { + const frontendDiv = document.getElementById(frontend) + if (frontend == divs[service].embedFrontend.value) { + frontendDiv.style.display = "block" + } else { + frontendDiv.style.display = "none" + } + } + } + } else if (Object.keys(config.services[service].frontends) > 1) divs[service].embedFrontend.disabled = true + } } -function changeNetworkSettings(selectedNetwork) { - for (const frontend in config.frontends) { - if (config.services[service].frontends[frontend].instanceList) { - const frontendDiv = document.getElementById(frontend) - for (const network in config.networks) { - const networkDiv = frontendDiv.getElementsByClassName(network)[0] - if (network == selectedNetwork) { - networkDiv.style.display = "block" - } else { - networkDiv.style.display = "none" +function changeNetworkSettings() { + for (const service in config.services) { + for (const frontend in config.services[service].frontends) { + if (config.services[service].frontends[frontend].instanceList) { + const frontendDiv = document.getElementById(frontend) + for (const network in config.networks) { + const networkDiv = frontendDiv.getElementsByClassName(network)[0] + if (network == selectedNetwork) { + networkDiv.style.display = "block" + } else { + networkDiv.style.display = "none" + } } } } } } -changeNetworkSettings(selectedNetwork) +changeNetworkSettings() for (const service in config.services) { divs[service] = {} divs[service][service] = document.getElementById(`${service}_page`) @@ -62,18 +83,20 @@ for (const service in config.services) { divs[service][option] = document.getElementById(`${service}-${option}`) browser.storage.local.get([`${service + utils.camelCase(option)}`], r => { - if (typeof config.services[service].options[option] == "boollean") divs[service][option].checked = r[service + utils.camelCase(option)] - else divs[service][option].value = !r[service + utils.camelCase(option)] + if (typeof config.services[service].options[option] == "boolean") divs[service][option].checked = r[service + utils.camelCase(option)] + else divs[service][option].value = r[service + utils.camelCase(option)] }) divs[service][option].addEventListener("change", () => { - if (typeof config.services[service].options[option] == "boollean") browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].checked }) + if (typeof config.services[service].options[option] == "boolean") browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].checked }) else browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].value }) - changeFrontendsSettings() + changeFrontendsSettings(service) }) } - changeFrontendsSettings(service) + if (Object.keys(config.services[service].frontends).length > 1) { + changeFrontendsSettings(service) + } for (const frontend in config.services[service].frontends) { if (config.services[service].frontends[frontend].instanceList) { -- cgit 1.4.1 From bd13604ea321bc569cf7721706fc1480be9f98f1 Mon Sep 17 00:00:00 2001 From: Woodpecker CI Date: Thu, 22 Sep 2022 00:10:29 +0000 Subject: updated instances --- src/instances/blacklist.json | 14 ++++++++------ src/instances/data.json | 24 ++++++++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 9df5b306..0f717cd2 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -1,13 +1,12 @@ { "cloudflare": [ - "https://invidious.kavin.rocks", "https://invidious.rhyshl.live", + "https://invidious.kavin.rocks", "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://piped.mha.fi", + "https://piped.syncpundit.com", "https://de-piped.shimul.me", - "https://pipedus.palash.dev", "https://watch.whatever.social", "https://piped.garudalinux.org", "https://y.rivo.lol", @@ -28,6 +27,7 @@ "https://nitter.sneed.network", "https://n.sneed.network", "https://nitter.twei.space", + "https://nitter.d420.de", "https://libreddit.domain.glass", "https://r.nf", "https://libreddit.hu", @@ -47,6 +47,7 @@ "https://tedd.it", "https://wiki.privacytools.io", "https://teddit.rawbit.ninja", + "https://wiki.604kph.xyz", "https://wiki.privacytools.io", "https://wikiless.rawbit.ninja", "https://scribe.rawbit.ninja", @@ -68,12 +69,12 @@ "offline": [ "https://invidious.rhyshl.live", "https://invidious.esmailelbob.xyz", + "https://invidious.kavin.rocks", "https://proxitok.odyssey346.dev", "https://nhanh.cloud", - "https://nitter.winscloud.net", + "https://nitter.hu", "https://ntr.odyssey346.dev", - "https://r.walkx.org", - "https://libreddit.winscloud.net", + "https://libredd.it", "https://libreddit.notyourcomputer.net", "https://teddit.ggc-project.de", "https://teddit.nautolan.racing", @@ -93,6 +94,7 @@ "https://whoogle.esmailelbob.xyz", "https://search.wef.lol", "https://i.bcow.xyz", + "https://i.actionsack.com", "https://lbry.bcow.xyz", "https://beatbump.ml" ] diff --git a/src/instances/data.json b/src/instances/data.json index e9533bfe..ee955bb6 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -4,7 +4,6 @@ "https://yewtu.be", "https://vid.puffyan.us", "https://invidious.snopyta.org", - "https://invidious.kavin.rocks", "https://inv.riverside.rocks", "https://invidio.xamh.de", "https://y.com.sb", @@ -22,7 +21,8 @@ "https://invidious.weblibre.org", "https://invidious.esmailelbob.xyz", "https://youtube.076.ne.jp", - "https://invidious.namazso.eu" + "https://invidious.namazso.eu", + "https://invidious.kavin.rocks" ], "tor": [ "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", @@ -44,16 +44,14 @@ "https://piped.kavin.rocks", "https://piped.tokhmi.xyz", "https://piped.moomoo.me", - "https://piped.mha.fi", + "https://piped.syncpundit.com", "https://de-piped.shimul.me", - "https://pipedus.palash.dev", "https://watch.whatever.social", "https://piped.garudalinux.org", "https://y.rivo.lol", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://il.ax", - "https://piped.privacy.com.de", "https://piped.projectsegfau.lt", "https://piped.privacydev.net", "https://piped.palveluntarjoaja.eu", @@ -205,7 +203,8 @@ "https://nitter.manasiwibi.com", "https://nitter.smnz.de", "https://nitter.twei.space", - "https://nitter.inpt.fr" + "https://nitter.inpt.fr", + "https://nitter.d420.de" ], "tor": [ "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -524,6 +523,7 @@ "normal": [ "https://dynabyte.ca", "https://jsearch.pw", + "https://privatus.live", "https://search.ethibox.fr", "https://search.snopyta.org", "https://search.stinpriza.org", @@ -585,7 +585,6 @@ "https://opnxng.com", "https://paulgo.io", "https://priv.au", - "https://privatus.live", "https://s.frlt.one", "https://s.zhaocloud.net", "https://saber.tk", @@ -657,6 +656,7 @@ "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", + "http://b2c7fvbhnfvwnl6oh2tydhzfx4i37kmmrycq42heqbbe7wovq3uzenid.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", @@ -665,7 +665,7 @@ "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion", - "http://lgmekfnpealdqhnctyg3p5fuelpdwnbqbwnl2ickpdoodzatzgz27ryd.onion" + "https://lgmekfnpealdqhnctyg3p5fuelpdwnbqbwnl2ickpdoodzatzgz27ryd.onion" ], "i2p": [], "loki": [] @@ -778,7 +778,8 @@ "normal": [ "https://hyperpipe.surge.sh", "https://hyperpipe.esmailelbob.xyz", - "https://listen.whatever.social" + "https://listen.whatever.social", + "https://music.adminforge.de" ], "tor": [ "http://hyperpipe.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion" @@ -806,6 +807,10 @@ "loki": [] }, "peertube": [ + "https://guntube.net", + "https://pt.freedomwolf.cc", + "https://vr360tube.online", + "https://bodavr.com", "https://peertube.tni-hosted.nl", "https://videos.parleur.net", "https://tube.azadehafzar.ir", @@ -833,7 +838,6 @@ "https://trutube.online", "https://tube-cycle-3.apps.education.fr", "https://video.manicphase.me", - "https://tube.emy.plus", "https://tubulus.openlatin.org", "https://video.graine-pdl.org", "https://tube-cycle-2.apps.education.fr", -- cgit 1.4.1 From 320d0175a8e1223618eb3b8d740b420ef674fc8d Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 22 Sep 2022 19:58:07 +0100 Subject: Completed Migration to ejs --- package.json | 2 +- src/assets/images/sendTargets-icon.svg | 52 +---- src/assets/javascripts/services.js | 8 +- src/config/config.json | 67 ++++-- src/instances/get_instances.py | 2 +- src/pages/options/index.html | 109 ++++++--- src/pages/options/widgets/services.js | 2 +- src/pages/popup/popup.ejs | 49 ++++ src/pages/popup/popup.html | 396 ++++++++++++++++++--------------- src/pages/popup/popup.pug | 155 ------------- src/pages/widgets/head.pug | 5 - src/pages/widgets/icons.pug | 46 ---- src/pages/widgets/instances.pug | 15 -- src/pages/widgets/latency.pug | 14 -- src/pages/widgets/links.ejs | 12 +- src/pages/widgets/links.pug | 83 ------- src/pages/widgets/switches.ejs | 11 + 17 files changed, 422 insertions(+), 606 deletions(-) create mode 100644 src/pages/popup/popup.ejs delete mode 100644 src/pages/popup/popup.pug delete mode 100644 src/pages/widgets/head.pug delete mode 100644 src/pages/widgets/icons.pug delete mode 100644 src/pages/widgets/instances.pug delete mode 100644 src/pages/widgets/latency.pug delete mode 100644 src/pages/widgets/links.pug create mode 100644 src/pages/widgets/switches.ejs diff --git a/package.json b/package.json index ee0d9089..76f57474 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "pug": "pug ./src/pages/options/*.pug ./src/pages/popup/ -P -w", "prettier": "npx prettier --write .", "instances": "python3 src/instances/get_instances.py; git update-index --assume-unchanged src/instances/blacklist.json src/instances/data.json", - "ejs": "npx ejs src/pages/options/index.ejs -f src/config/config.json -o src/pages/options/index.html" + "ejs": "npx ejs src/pages/options/index.ejs -f src/config/config.json -o src/pages/options/index.html; npx ejs src/pages/popup/popup.ejs -f src/config/config.json -o src/pages/popup/popup.html" }, "repository": { "type": "git", diff --git a/src/assets/images/sendTargets-icon.svg b/src/assets/images/sendTargets-icon.svg index 2ed80a06..5557664e 100644 --- a/src/assets/images/sendTargets-icon.svg +++ b/src/assets/images/sendTargets-icon.svg @@ -1,51 +1,3 @@ - - - - - - - - + + diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 79444442..f4c30873 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -68,7 +68,7 @@ function redirect(url, type, initiator) { let redirectType if (url.pathname == "/") return for (const service in config.services) { - if (!options[service].enabled && !disableOverride) continue + if (!options[service].enabled) continue let targets = service.targets if (targets == "datajson") { browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) @@ -385,12 +385,12 @@ function initDefaults() { .then(response => response.text()) .then(async data => { let dataJson = JSON.parse(data) - redirects = dataJson.slice() + redirects = JSON.parse(data) browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { for (const service in config.services) { if (config.services[service].targets == "datajson") { browser.storage.local.set({ [service + "Targets"]: [...dataJson[service]] }) - delete redirects[service] + delete dataJson[service] } for (const defaultOption in config.services[service].options) { browser.storage.local.set({ [service + utils.camelCase(defaultOption)]: config.services[service].options[defaultOption] }) @@ -422,7 +422,7 @@ function initDefaults() { } }) browser.storage.local.set({ - redirects, + redirects: dataJson, }) ;() => resolve() }) diff --git a/src/config/config.json b/src/config/config.json index ac393f18..1c8f5f9f 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -102,7 +102,8 @@ "embedFrontend": "invidious" }, "imageType": "png", - "embeddable": true + "embeddable": true, + "url": "https://youtube.com" }, "youtubeMusic": { "frontends": { @@ -130,7 +131,8 @@ "frontend": "beatbump" }, "imageType": "png", - "embeddable": false + "embeddable": false, + "url": "https://music.youtube.com" }, "twitter": { "frontends": { @@ -169,7 +171,8 @@ "redirectType": "both" }, "imageType": "png", - "embeddable": true + "embeddable": true, + "url": "https://twitter.com" }, "instagram": { "frontends": { @@ -187,7 +190,8 @@ "name": "Instagram", "options": { "enabled": true }, "imageType": "png", - "embeddable": false + "embeddable": false, + "url": "https://instagram.com" }, "tiktok": { "frontends": { @@ -203,7 +207,8 @@ "name": "TikTok", "options": { "enabled": true }, "imageType": "png", - "embeddable": false + "embeddable": false, + "url": "https://tiktok.com" }, "reddit": { "frontends": { @@ -242,7 +247,8 @@ "frontend": "libreddit" }, "imageType": "png", - "embeddable": false + "embeddable": false, + "url": "https://reddit.com" }, "imgur": { "frontends": { @@ -256,7 +262,8 @@ "name": "Imgur", "options": { "enabled": true }, "imageType": "png", - "embeddable": false + "embeddable": false, + "url": "https://imgur.com" }, "wikipedia": { "frontends": { @@ -272,7 +279,8 @@ "name": "Wikipedia", "options": { "enabled": false }, "imageType": "svg", - "embeddable": false + "embeddable": false, + "url": "https://wikipedia.com" }, "medium": { "frontends": { @@ -304,8 +312,9 @@ ], "name": "Medium", "options": { "enabled": true }, - "imageType": "svg", - "embeddable": false + "imageType": "svgMono", + "embeddable": false, + "url": "https://medium.com" }, "quora": { "frontends": { @@ -321,7 +330,8 @@ "name": "Quora", "options": { "enabled": true }, "imageType": "png", - "embeddable": false + "embeddable": false, + "url": "https://quora.com" }, "imdb": { "frontends": { @@ -337,7 +347,8 @@ "name": "IMDb", "options": { "enabled": false }, "imageType": "svg", - "embeddable": false + "embeddable": false, + "url": "https://imdb.com" }, "reuters": { "frontends": { @@ -351,7 +362,8 @@ "name": "Reuters", "options": { "enabled": false }, "imageType": "svg", - "embeddable": false + "embeddable": false, + "url": "https://reuters.com" }, "peertube": { "frontends": { @@ -365,7 +377,8 @@ "name": "PeerTube", "options": { "enabled": false }, "imageType": "svg", - "embeddable": false + "embeddable": false, + "url": "https://search.joinpeertube.org" }, "lbry": { "frontends": { @@ -389,10 +402,12 @@ "options": { "enabled": false, "frontend": "librarian", - "redirectType": "both" + "redirectType": "both", + "embedFrontend": "librarian" }, "imageType": "png", - "embeddable": true + "embeddable": true, + "url": "https://odysee.com" }, "search": { "frontends": { @@ -467,8 +482,9 @@ "enabled": true, "frontend": "searxng" }, - "imageType": "svg", - "embeddable": false + "imageType": "svgMono", + "embeddable": false, + "url": "https://search.libredirect.invalid" }, "translate": { "frontends": { @@ -493,8 +509,9 @@ "enabled": true, "frontend": "simplyTranslate" }, - "imageType": "svg", - "embeddable": false + "imageType": "svgMono", + "embeddable": false, + "url": "https://translate.google.com" }, "maps": { "frontends": { @@ -514,8 +531,9 @@ "enabled": true, "frontend": "osm" }, - "imageType": "svg", - "embeddable": false + "imageType": "svgMono", + "embeddable": false, + "url": "https://maps.google.com" }, "sendTargets": { "frontends": { @@ -528,8 +546,9 @@ "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid\\/$", "^https?:\\/{2}send\\.firefox\\.com\\/$", "^https?:\\/{2}sendfiles\\.online\\/$"], "name": "Send Files", "options": { "enabled": true }, - "imageType": "svg", - "embeddable": false + "imageType": "svgMono", + "embeddable": false, + "url": "https://send.libredirect.invalid" } } } diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 2547917a..85bdf1cf 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -446,7 +446,7 @@ def peertube(): 'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt') rJson = json.loads(r.text) - myList = [] + myList = ['https://search.joinpeertube.org'] for k in rJson['data']: myList.append('https://'+k['host']) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index e1163e99..a23ff247 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -10,26 +10,85 @@
@@ -169,7 +228,7 @@
-
+
medium
@@ -205,25 +264,25 @@
-
+
search
-
+
translate
-
+
maps
-
+
sendTargets
diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index 69840de4..b595943e 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -53,7 +53,7 @@ function changeFrontendsSettings(service) { } } } - } else if (Object.keys(config.services[service].frontends) > 1) divs[service].embedFrontend.disabled = true + } else if (Object.keys(config.services[service].frontends).length > 1) divs[service].embedFrontend.disabled = true } } diff --git a/src/pages/popup/popup.ejs b/src/pages/popup/popup.ejs new file mode 100644 index 00000000..efb73e5c --- /dev/null +++ b/src/pages/popup/popup.ejs @@ -0,0 +1,49 @@ + + + + + + + + + +
+ <%- include('src/pages/widgets/switches', {config: config}) -%> +
+
+
+
+
+ <%- include('src/pages/widgets/switches', {config: config}) -%> +
+
+ + + + + +
+ + + + diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 25f70f48..e21a63a0 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -8,189 +8,227 @@
@@ -222,4 +260,4 @@ - \ No newline at end of file + diff --git a/src/pages/popup/popup.pug b/src/pages/popup/popup.pug deleted file mode 100644 index 7da687cc..00000000 --- a/src/pages/popup/popup.pug +++ /dev/null @@ -1,155 +0,0 @@ -include ../widgets/icons.pug - -mixin services - .youtube.some-block - a.title(href="https://youtube.com") - img(src="../../assets/images/youtube-icon.png") - h4(data-localise="__MSG_youtube__") YouTube - input.disable-youtube(type="checkbox") - - .youtubeMusic.some-block - a.title(href="https://music.youtube.com") - img(src="../../assets/images/youtube-music-icon.png") - h4(data-localise="__MSG_ytmusic__") YT Music - input.disable-youtubeMusic(type="checkbox") - - .twitter.some-block - a.title(href="https://twitter.com") - img(src="../../assets/images/twitter-icon.png") - h4(data-localise="__MSG_twitter__") Twitter - input.disable-nitter(type="checkbox") - - .instagram.some-block - a.title(href="https://instagram.com") - img(src="../../assets/images/instagram-icon.png") - h4(data-localise="__MSG_instagram__") Instagram - input.disable-bibliogram(type="checkbox") - - .tiktok.some-block - a.title(href="https://tiktok.com") - img(src="../../assets/images/tiktok-icon.png") - h4(data-localise="__MSG_tiktok__") TikTok - input.disable-tiktok(type="checkbox") - - .imgur.some-block - a.title(href="https://imgur.com") - img(src="../../assets/images/imgur.png") - h4(data-localise="__MSG_imgur__") Imgur - input.disable-imgur(type="checkbox") - - .reddit.some-block - a.title(href="https://reddit.com") - img(src="../../assets/images/reddit-icon.png") - h4(data-localise="__MSG_reddit__") Reddit - input.disable-reddit(type="checkbox") - - .wikipedia.some-block - a.title(href="https://wikipedia.com") - img(src="../../assets/images/wikipedia-icon.svg") - h4(data-localise="__MSG_wikipedia__") Wikipedia - input.disable-wikipedia(type="checkbox") - - .medium.some-block - a.title(href="https://medium.com") - +medium - h4(data-localise="__MSG_medium__") Medium - input.disable-medium(type="checkbox") - - .quora.some-block - a.title(href="https://quora.com") - img(src="../../assets/images/quora.png") - h4(data-localise="__MSG_quora__") Quora - input.disable-quora(type="checkbox") - - .imdb.some-block - a.title(href="https://imdb.com") - img(src="../../assets/images/imdb.svg") - h4(data-localise="__MSG_imdb__") IMDb - input.disable-imdb(type="checkbox") - - .reuters.some-block - a.title(href="https://reuters.com") - img(src="../../assets/images/reuters.svg") - h4(data-localise="__MSG_reuters__") Reuters - input.disable-reuters(type="checkbox") - - .peertube.some-block - a.title(href="https://search.joinpeertube.org") - img(src="../../assets/images/peertube-icon.svg") - h4(data-localise="__MSG_peertube__") PeerTube - input.disable-peertube(type="checkbox") - - .lbry.some-block - a.title(href="https://odysee.com/") - img(src="../../assets/images/lbry-icon.png") - h4(data-localise="__MSG_lbry__") LBRY - input.disable-lbry(type="checkbox") - - .search.some-block - a.title(href="https://search.libredirect.invalid") - +search - h4(data-localise="__MSG_search__") Search - input.disable-search(type="checkbox") - - .translate.some-block - a.title(href="https://translate.google.com") - +translate - h4(data-localise="__MSG_translate__") Translate - input.disable-translate(type="checkbox") - - .maps.some-block - a.title(href="https://www.openstreetmap.org") - +maps - h4(data-localise="__MSG_maps__") Maps - input.disable-osm(type="checkbox") - - .sendTargets.some-block - a.title(href="https://send.libredirect.invalid") - +send - h4(data-localise="__MSG_sendFiles__") Send Files - input.disable-sendTargets(type="checkbox") - -doctype html -html(lang="en") - head - meta(charset="utf-8") - meta(name="viewport" content="width=device-width, initial-scale=1") - link(href="../stylesheets/styles.css" rel="stylesheet") - link(href="./style.css" rel="stylesheet") - body(dir="auto") - .current_site - +services - #current_site_divider - hr - .all_sites - +services - hr - #change_instance_div.some-block - a#change_instance.title.button.prevent - h4(data-localise="__MSG_switchInstance__") Change Instance - +change_instance - - #copy_raw_div.some-block(title="Copy the original redirected link") - a#copy_raw.title.button.prevent - h4(data-localise="__MSG_copyRaw__") Copy Raw - +copy_raw - - #unify_div.some-block(title="Unify cookies across all selected instances") - a#unify.title.button.prevent - h4(data-localise="__MSG_unifySettings__") Unify Settings - +unify - - .some-block - a#more-options.title.button.prevent - h4(data-localise="__MSG_settings__") Settings - +settings - - .some-block - a#about.title.button(href="/pages/options/index.html#about") - h4(data-localise="__MSG_about__") About - +about - - .space - - script(type="module" src="../options/init.js") - script(type="module" src="./popup.js") diff --git a/src/pages/widgets/head.pug b/src/pages/widgets/head.pug deleted file mode 100644 index 53de42d3..00000000 --- a/src/pages/widgets/head.pug +++ /dev/null @@ -1,5 +0,0 @@ -head - meta(charset='utf-8') - meta(name="viewport" content="width=device-width, initial-scale=1") - link(rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg") - link(href="../../stylesheets/styles.css" rel="stylesheet") \ No newline at end of file diff --git a/src/pages/widgets/icons.pug b/src/pages/widgets/icons.pug deleted file mode 100644 index cc77ad16..00000000 --- a/src/pages/widgets/icons.pug +++ /dev/null @@ -1,46 +0,0 @@ -mixin medium - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor") - circle(cx="500" cy="500" r="500") - ellipse(ry="475" rx="250" cy="501" cx="1296") - ellipse(cx="1682" cy="502" rx="88" ry="424") - -mixin search - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z") - -mixin translate - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z") - -mixin maps - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path( d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z") - -mixin send - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z") - -mixin change_instance - svg(xmlns="http://www.w3.org/2000/svg" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor") - path(d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z") - -mixin settings - svg(xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" - width="26px" fill="currentColor") - path(d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z") - -mixin copy_raw - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z") - -mixin general - svg(xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor") - path(d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z") - -mixin unify - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z") - -mixin about - svg( xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="currentColor") - path( d="M11 17h2v-6h-2Zm1-8q.425 0 .713-.288Q13 8.425 13 8t-.287-.713Q12.425 7 12 7t-.712.287Q11 7.575 11 8t.288.712Q11.575 9 12 9Zm0 13q-2.075 0-3.9-.788-1.825-.787-3.175-2.137-1.35-1.35-2.137-3.175Q2 14.075 2 12t.788-3.9q.787-1.825 2.137-3.175 1.35-1.35 3.175-2.138Q9.925 2 12 2t3.9.787q1.825.788 3.175 2.138 1.35 1.35 2.137 3.175Q22 9.925 22 12t-.788 3.9q-.787 1.825-2.137 3.175-1.35 1.35-3.175 2.137Q14.075 22 12 22Zm0-2q3.35 0 5.675-2.325Q20 15.35 20 12q0-3.35-2.325-5.675Q15.35 4 12 4 8.65 4 6.325 6.325 4 8.65 4 12q0 3a.35 2.325 5.675Q8.65 20 12 20Zm0-8Z") \ No newline at end of file diff --git a/src/pages/widgets/instances.pug b/src/pages/widgets/instances.pug deleted file mode 100644 index 950bd46b..00000000 --- a/src/pages/widgets/instances.pug +++ /dev/null @@ -1,15 +0,0 @@ -mixin instances(myPlaceholder) - .some-block.option-block - h4(data-localise="__MSG_defaultInstances__") Default Instances - - .checklist - hr - .some-block.option-block - h4(data-localise="__MSG_customInstances__") Custom Instances - form.custom-instance-form - .some-block.option-block - input.custom-instance(placeholder=myPlaceholder type="url") - button.add.add-instance(type="submit") - svg(xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor") - path(d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z") - .checklist.custom-checklist \ No newline at end of file diff --git a/src/pages/widgets/latency.pug b/src/pages/widgets/latency.pug deleted file mode 100644 index e5bf53b2..00000000 --- a/src/pages/widgets/latency.pug +++ /dev/null @@ -1,14 +0,0 @@ -mixin latency(service) - - var latencyVal - if (service) - - latencyVal = `latency-${service}` - else - - latencyVal = `latency` - - .buttons.buttons-inline - label.button.button-inline(id=`${latencyVal}-label` for=latencyVal) - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z") - |  - x(data-localise="__MSG_testInstancesLatency__") Test Instances Latency - input.button.button-inline(id=latencyVal style="display:none;") \ No newline at end of file diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index c28d3668..86b9f260 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -1,7 +1,13 @@ diff --git a/src/pages/widgets/links.pug b/src/pages/widgets/links.pug deleted file mode 100644 index c7f8e0a6..00000000 --- a/src/pages/widgets/links.pug +++ /dev/null @@ -1,83 +0,0 @@ -include ./icons.pug - -mixin links(service) - section#links.links - .title - +general - a(href="#general" data-localise="__MSG_general__") General - - .title - img(src="../../../assets/images/youtube-icon.png") - a(href="#youtube" data-localise="__MSG_youtube__") YouTube - - .title - img(src="../../../assets/images/youtube-music-icon.png") - a(href="#youtubeMusic" data-localise="__MSG_ytmusic__") YT Music - - .title - img(src="../../../assets/images/twitter-icon.png") - a(href="#twitter" data-localise="__MSG_twitter__") Twitter - - .title - img(src="../../../assets/images/instagram-icon.png") - a(href="#instagram" data-localise="__MSG_instagram__") Instagram - - .title - img(src="../../../assets/images/tiktok-icon.png") - a(href="#tiktok" data-localise="__MSG_tiktok__") TikTok - - .title - img(src="../../../assets/images/reddit-icon.png") - a(href="#reddit" data-localise="__MSG_reddit__") Reddit - - .title - img(src="../../../assets/images/imgur.png") - a(href="#imgur" data-localise="__MSG_imgur__") Imgur - - .title - img(src="../../../assets/images/wikipedia-icon.svg") - a(href="#wikipedia" data-localise="__MSG_wikipedia__") Wikipedia - - .title - +medium - a(href="#medium" data-localise="__MSG_medium__") Medium - - .title - img(src="../../../assets/images/quora.png") - a(href="#quora" data-localise="__MSG_quora__") Quora - - .title - img(src="../../../assets/images/imdb.svg") - a(href="#imdb" data-localise="__MSG_imdb__") IMDb - - .title - img(src="../../../assets/images/reuters.svg") - a(href="#reuters" data-localise="__MSG_reuters__") Reuters - - .title - img(src="../../../assets/images/peertube-icon.svg") - a(href="#peertube" data-localise="__MSG_peertube__") PeerTube - - .title - img(src="../../../assets/images/lbry-icon.png") - a(href="#lbry" data-localise="__MSG_lbry__") LBRY - - .title - +search - a(href="#search" data-localise="__MSG_search__") Search - - .title - +translate - a(href="#translate" data-localise="__MSG_translate__") Translate - - .title - +maps - a(href="#maps" data-localise="__MSG_maps__") Maps - - .title - +send - a(href="#sendTargets" data-localise="__MSG_sendFiles__") Send Files - - .title - +about - a(href="#about" data-localise="__MSG_about") About diff --git a/src/pages/widgets/switches.ejs b/src/pages/widgets/switches.ejs new file mode 100644 index 00000000..45bcd790 --- /dev/null +++ b/src/pages/widgets/switches.ejs @@ -0,0 +1,11 @@ +<% for (const service in config.services) { -%> + +<% } %> -- cgit 1.4.1 From f87eb20ceed147362f4d446aa10e15f865c0bc16 Mon Sep 17 00:00:00 2001 From: Hygna Date: Fri, 23 Sep 2022 20:57:25 +0100 Subject: Started optimizing popup.js --- src/assets/javascripts/services.js | 43 +++- src/config/config.json | 10 +- src/pages/background/background.js | 2 + src/pages/options/index.html | 36 +-- src/pages/popup/popup.js | 494 +++++++------------------------------ src/pages/widgets/links.ejs | 2 +- 6 files changed, 154 insertions(+), 433 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index f4c30873..d3b7290f 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -20,10 +20,10 @@ async function getConfig() { function init() { return new Promise(async resolve => { - browser.storage.local.get(["network", "networkFallback"], r => { + browser.storage.local.get(["network", "networkFallback", "redirects"], r => { options.network = r.network options.networkFallback = r.networkFallback - options.redirects = r.redirects + redirects = r.redirects }) for (const service in config.services) { options[service] = {} @@ -50,14 +50,26 @@ function init() { function all(service) { let tmp = [] - for (frontend in config.services[service].frontends) { - for (network in config.networks) tmp.push([...redirects[frontend][network]]) + for (const frontend in config.services[service].frontends) { + if (config.services[service].frontends[frontend].instanceList) { + for (const network in config.networks) { + tmp.push(...redirects[frontend][network]) + } + } } return tmp } +function regexArray(service, url) { + for (const targetString in config.services[service].targets) { + const target = new RegExp(config.services[service].targets[targetString]) + if (target.test(url.href)) return true + } + return false +} + await getConfig() -init() +await init() browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { @@ -69,7 +81,7 @@ function redirect(url, type, initiator) { if (url.pathname == "/") return for (const service in config.services) { if (!options[service].enabled) continue - let targets = service.targets + let targets = config.services[service].targets if (targets == "datajson") { browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) } @@ -424,12 +436,29 @@ function initDefaults() { browser.storage.local.set({ redirects: dataJson, }) - ;() => resolve() + resolve() }) }) } +function computeService(url) { + for (const service in config.services) { + const regex = config.services[service].targets + console.log(regex) + if (regexArray(service, url)) { + console.log(service + "gi") + return service + } else if (all(service).includes(utils.protocolHost(url))) { + console.log(service) + return service + } + } + console.log("moment") + return null +} + export default { redirect, initDefaults, + computeService, } diff --git a/src/config/config.json b/src/config/config.json index 1c8f5f9f..a4bcf125 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -87,12 +87,12 @@ }, "singleInstanceFrontends": ["freetube", "yatte"], "targets": [ - "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api)/.*|$)", + "^https?:\\/{2}(?:www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api/.*|$)", "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", + "^https?:\\/{2}(?:i|s)\\.ytimg.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(?:www\\.|music\\.|)youtube.com\\/watch?v=..*", "^https?:\\/{2}youtu\\.be\\/..*", - "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" + "^https?:\\/{2}(?:www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" ], "name": "Youtube", "options": { @@ -275,7 +275,7 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], + "targets": ["^https?:\\/{2}(?:[a-z]+\\.)*wikipedia\\.org"], "name": "Wikipedia", "options": { "enabled": false }, "imageType": "svg", diff --git a/src/pages/background/background.js b/src/pages/background/background.js index e93e3d03..e0228df6 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -145,6 +145,7 @@ browser.tabs.onRemoved.addListener(tabId => { } }) +/* browser.webRequest.onHeadersReceived.addListener( e => { let response = youtubeHelper.removeXFrameOptions(e) @@ -154,6 +155,7 @@ browser.webRequest.onHeadersReceived.addListener( { urls: [""] }, ["blocking", "responseHeaders"] ) +*/ async function redirectOfflineInstance(url, tabId) { let newUrl = await youtubeHelper.switchInstance(url, true) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index a23ff247..b6ea1535 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -16,28 +16,28 @@ General
+ Youtube
+ YT Music
+ Twitter
+ Instagram
+ TikTok
+ Reddit
+ Imgur
+ Wikipedia
@@ -45,46 +45,46 @@ - medium
+ Medium
+ Quora
- imdb
+ IMDb + Reuters + PeerTube
- lbry
+ LBRY + Search + Translate
- maps
+ Maps + Send Files
diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index 465080c5..fa269e6d 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -3,40 +3,7 @@ window.browser = window.browser || window.chrome import utils from "../../assets/javascripts/utils.js" import generalHelper from "../../assets/javascripts/general.js" - -import youtubeHelper from "../../assets/javascripts/youtube/youtube.js" -import youtubeMusicHelper from "../../assets/javascripts/youtubeMusic.js" -import twitterHelper from "../../assets/javascripts/twitter.js" -import instagramHelper from "../../assets/javascripts/instagram.js" -import redditHelper from "../../assets/javascripts/reddit.js" -import searchHelper from "../../assets/javascripts/search.js" -import translateHelper from "../../assets/javascripts/translate/translate.js" -import mapsHelper from "../../assets/javascripts/maps.js" -import wikipediaHelper from "../../assets/javascripts/wikipedia.js" -import mediumHelper from "../../assets/javascripts/medium.js" -import quoraHelper from "../../assets/javascripts/quora.js" -import libremdbHelper from "../../assets/javascripts/imdb.js" -import reutersHelper from "../../assets/javascripts/reuters.js" -import imgurHelper from "../../assets/javascripts/imgur.js" -import tiktokHelper from "../../assets/javascripts/tiktok.js" -import sendTargetsHelper from "../../assets/javascripts/sendTargets.js" -import peertubeHelper from "../../assets/javascripts/peertube.js" -import lbryHelper from "../../assets/javascripts/lbry.js" - -utils.unify(true).then(r => { - if (!r) document.getElementById("unify_div").style.display = "none" - else { - const unify = document.getElementById("unify") - const textElement = document.getElementById("unify").getElementsByTagName("h4")[0] - unify.addEventListener("click", () => { - const oldHtml = textElement.innerHTML - textElement.innerHTML = "..." - browser.runtime.sendMessage({ function: "unify" }, response => { - if (response && response.response) textElement.innerHTML = oldHtml - }) - }) - } -}) +import serviceHelper from "../../assets/javascripts/services.js" utils.switchInstance(true).then(r => { if (!r) document.getElementById("change_instance_div").style.display = "none" @@ -52,389 +19,112 @@ utils.copyRaw(true).then(r => { }) document.getElementById("more-options").addEventListener("click", () => browser.runtime.openOptionsPage()) -const allSites = document.getElementsByClassName("all_sites")[0] -const currSite = document.getElementsByClassName("current_site")[0] - -const disableTwitterCurrentSite = currSite.getElementsByClassName("disable-nitter")[0] -const disableTwitterAllSites = allSites.getElementsByClassName("disable-nitter")[0] - -const disableYoutubeCurrentSite = currSite.getElementsByClassName("disable-youtube")[0] -const disableYoutubeAllSites = allSites.getElementsByClassName("disable-youtube")[0] - -const disableYoutubeMusicCurrentSite = currSite.getElementsByClassName("disable-youtubeMusic")[0] -const disableYoutubeMusicAllSites = allSites.getElementsByClassName("disable-youtubeMusic")[0] - -const disableInstagramCurrentSite = currSite.getElementsByClassName("disable-bibliogram")[0] -const disableInstagramAllSites = allSites.getElementsByClassName("disable-bibliogram")[0] - -const disableMapsCurrentSite = currSite.getElementsByClassName("disable-osm")[0] -const disableMapsAllSites = allSites.getElementsByClassName("disable-osm")[0] - -const disableRedditCurrentSite = currSite.getElementsByClassName("disable-reddit")[0] -const disableRedditAllSites = allSites.getElementsByClassName("disable-reddit")[0] - -const disableSearchCurrentSite = currSite.getElementsByClassName("disable-search")[0] -const disableSearchAllSites = allSites.getElementsByClassName("disable-search")[0] - -const disableTranslateCurrentSite = currSite.getElementsByClassName("disable-translate")[0] -const disableTranslateAllSites = allSites.getElementsByClassName("disable-translate")[0] - -const disableWikipediaCurrentSite = currSite.getElementsByClassName("disable-wikipedia")[0] -const disableWikipediaAllSites = allSites.getElementsByClassName("disable-wikipedia")[0] - -const disableMediumCurrentSite = currSite.getElementsByClassName("disable-medium")[0] -const disableMediumAllSites = allSites.getElementsByClassName("disable-medium")[0] - -const disableQuoraCurrentSite = currSite.getElementsByClassName("disable-quora")[0] -const disableQuoraAllSites = allSites.getElementsByClassName("disable-quora")[0] - -const disableImdbCurrentSite = currSite.getElementsByClassName("disable-imdb")[0] -const disableImdbAllSites = allSites.getElementsByClassName("disable-imdb")[0] - -const disableReutersCurrentSite = currSite.getElementsByClassName("disable-reuters")[0] -const disableReutersAllSites = allSites.getElementsByClassName("disable-reuters")[0] - -const disablePeertubeTargetsCurrentSite = currSite.getElementsByClassName("disable-peertube")[0] -const disablePeertubeTargetsAllSites = allSites.getElementsByClassName("disable-peertube")[0] +let config +let divs = {} + +async function getConfig() { + return new Promise(resolve => { + fetch("/config/config.json") + .then(response => response.text()) + .then(data => { + const tmp = JSON.parse(data) + config = tmp.config + resolve() + }) + }) +} -const disableLbryTargetsCurrentSite = currSite.getElementsByClassName("disable-lbry")[0] -const disableLbryTargetsAllSites = allSites.getElementsByClassName("disable-lbry")[0] +await getConfig() -const disableSendTargetsCurrentSite = currSite.getElementsByClassName("disable-sendTargets")[0] -const disableSendTargetsAllSites = allSites.getElementsByClassName("disable-sendTargets")[0] +const allSites = document.getElementsByClassName("all_sites")[0] +const currSite = document.getElementsByClassName("current_site")[0] -const disableImgurCurrentSite = currSite.getElementsByClassName("disable-imgur")[0] -const disableImgurAllSites = allSites.getElementsByClassName("disable-imgur")[0] +function setDivs() { + return new Promise(resolve => { + for (const service in config.services) { + divs[service] = {} + divs[service].toggle = {} + divs[service].current = currSite.getElementsByClassName(service)[0] + divs[service].all = allSites.getElementsByClassName(service)[0] + divs[service].toggle.current = currSite.getElementsByClassName(service + "-enabled")[0] + divs[service].toggle.all = allSites.getElementsByClassName(service + "-enabled")[0] + } + resolve() + }) +} -const disableTiktokCurrentSite = currSite.getElementsByClassName("disable-tiktok")[0] -const disableTiktokAllSites = allSites.getElementsByClassName("disable-tiktok")[0] +await setDivs() const currentSiteIsFrontend = document.getElementById("current_site_divider") -browser.storage.local.get( - [ - "disableTwitter", - "disableYoutube", - "disableYoutubeMusic", - "disableInstagram", - "disableMaps", - "disableReddit", - "disableSearch", - "translateDisable", - "disableWikipedia", - "disableImgur", - "disableTiktok", - "disableMedium", - "disableQuora", - "disableImdb", - "disableReuters", - "disablePeertubeTargets", - "disableLbryTargets", - "disableSendTarget", - "popupFrontends", - ], - r => { - disableTwitterCurrentSite.checked = !r.disableTwitter - disableTwitterAllSites.checked = !r.disableTwitter - disableYoutubeCurrentSite.checked = !r.disableYoutube - disableYoutubeAllSites.checked = !r.disableYoutube - disableYoutubeMusicCurrentSite.checked = !r.disableYoutubeMusic - disableYoutubeMusicAllSites.checked = !r.disableYoutubeMusic - disableInstagramCurrentSite.checked = !r.disableInstagram - disableInstagramAllSites.checked = !r.disableInstagram - disableMapsCurrentSite.checked = !r.disableMaps - disableMapsAllSites.checked = !r.disableMaps - disableRedditCurrentSite.checked = !r.disableReddit - disableRedditAllSites.checked = !r.disableReddit - disableSearchCurrentSite.checked = !r.disableSearch - disableSearchAllSites.checked = !r.disableSearch - disableTranslateCurrentSite.checked = !r.translateDisable - disableTranslateAllSites.checked = !r.translateDisable - disableWikipediaCurrentSite.checked = !r.disableWikipedia - disableWikipediaAllSites.checked = !r.disableWikipedia - disableImgurCurrentSite.checked = !r.disableImgur - disableImgurAllSites.checked = !r.disableImgur - disableTiktokCurrentSite.checked = !r.disableTiktok - disableTiktokAllSites.checked = !r.disableTiktok - disableMediumCurrentSite.checked = !r.disableMedium - disableMediumAllSites.checked = !r.disableMedium - disableQuoraCurrentSite.checked = !r.disableQuora - disableQuoraAllSites.checked = !r.disableQuora - disableImdbCurrentSite.checked = !r.disableImdb - disableImdbAllSites.checked = !r.disableImdb - disableReutersCurrentSite.checked = !r.disableReuters - disableReutersAllSites.checked = !r.disableReuters - disablePeertubeTargetsCurrentSite.checked = !r.disablePeertubeTargets - disablePeertubeTargetsAllSites.checked = !r.disablePeertubeTargets - disableLbryTargetsCurrentSite.checked = !r.disableLbryTargets - disableLbryTargetsAllSites.checked = !r.disableLbryTargets - disableSendTargetsCurrentSite.checked = !r.disableSendTarget - disableSendTargetsAllSites.checked = !r.disableSendTarget +function getEnabled() { + return new Promise(async resolve => { + for (const service in config.services) { + browser.storage.local.get(`${service}Enabled`, r => { + divs[service].toggle.all.checked = r[service + "Enabled"] + divs[service].toggle.current.checked = r[service + "Enabled"] + }) + } + resolve() + }) +} - browser.tabs.query({ active: true, currentWindow: true }, async tabs => { - for (const frontend of generalHelper.allPopupFrontends) { - if (!r.popupFrontends.includes(frontend)) allSites.getElementsByClassName(frontend)[0].classList.add("hide") - else allSites.getElementsByClassName(frontend)[0].classList.remove("hide") - currSite.getElementsByClassName(frontend)[0].classList.add("hide") - } +browser.storage.local.get("popupFrontends", r => { + browser.tabs.query({ active: true, currentWindow: true }, async tabs => { + for (const frontend of generalHelper.allPopupFrontends) { + if (!r.popupFrontends.includes(frontend)) allSites.getElementsByClassName(frontend)[0].classList.add("hide") + else allSites.getElementsByClassName(frontend)[0].classList.remove("hide") + currSite.getElementsByClassName(frontend)[0].classList.add("hide") + } - let url - try { - url = new URL(tabs[0].url) - } catch { - currentSiteIsFrontend.classList.add("hide") - return - } + let url + try { + url = new URL(tabs[0].url) + console.log(url.href) + } catch { + currentSiteIsFrontend.classList.add("hide") + return + } - if (youtubeMusicHelper.redirect(url, "main_frame", false, true) || (await youtubeMusicHelper.switchInstance(url, true))) { - currSite.getElementsByClassName("youtubeMusic")[0].classList.remove("hide") - allSites.getElementsByClassName("youtubeMusic")[0].classList.add("hide") - } else if (twitterHelper.redirect(url, "main_frame", false, true) || (await twitterHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("twitter")[0].classList.remove("hide") - allSites.getElementsByClassName("twitter")[0].classList.add("hide") - } else if (instagramHelper.redirect(url, "main_frame", false, true) || (await instagramHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("instagram")[0].classList.remove("hide") - allSites.getElementsByClassName("instagram")[0].classList.add("hide") - } else if (mapsHelper.redirect(url, false)) { - currSite.getElementsByClassName("maps")[0].classList.remove("hide") - allSites.getElementsByClassName("maps")[0].classList.add("hide") - } else if (redditHelper.redirect(url, "main_frame", false, true) || (await redditHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("reddit")[0].classList.remove("hide") - allSites.getElementsByClassName("reddit")[0].classList.add("hide") - } else if (mediumHelper.redirect(url, "main_frame", false, true) || (await mediumHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("medium")[0].classList.remove("hide") - allSites.getElementsByClassName("medium")[0].classList.add("hide") - } else if (quoraHelper.redirect(url, "main_frame", false, true) || (await quoraHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("quora")[0].classList.remove("hide") - allSites.getElementsByClassName("quora")[0].classList.add("hide") - } else if (libremdbHelper.redirect(url, "main_frame", false, true) || (await libremdbHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("imdb")[0].classList.remove("hide") - allSites.getElementsByClassName("imdb")[0].classList.add("hide") - } else if (reutersHelper.redirect(url, "main_frame", false, true)) { - currSite.getElementsByClassName("reuters")[0].classList.remove("hide") - allSites.getElementsByClassName("reuters")[0].classList.add("hide") - } else if (imgurHelper.redirect(url, "main_frame", false, true) || (await imgurHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("imgur")[0].classList.remove("hide") - allSites.getElementsByClassName("imgur")[0].classList.add("hide") - } else if (tiktokHelper.redirect(url, "main_frame", false, true) || (await tiktokHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("tiktok")[0].classList.remove("hide") - allSites.getElementsByClassName("tiktok")[0].classList.add("hide") - } else if (sendTargetsHelper.redirect(url, "main_frame", false, true) || (await sendTargetsHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("sendTargets")[0].classList.remove("hide") - allSites.getElementsByClassName("sendTargets")[0].classList.add("hide") - } else if (peertubeHelper.redirect(url, "main_frame", false, true) || (await peertubeHelper.switchInstance(url, true))) { - currSite.getElementsByClassName("peertube")[0].classList.remove("hide") - allSites.getElementsByClassName("peertube")[0].classList.add("hide") - } else if (lbryHelper.redirect(url, "main_frame", false, true) || (await lbryHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("lbry")[0].classList.remove("hide") - allSites.getElementsByClassName("lbry")[0].classList.add("hide") - } else if (translateHelper.redirect(url, true) || (await translateHelper.switchInstance(url, true))) { - currSite.getElementsByClassName("translate")[0].classList.remove("hide") - allSites.getElementsByClassName("translate")[0].classList.add("hide") - } else if (searchHelper.redirect(url, true) || (await searchHelper.switchInstance(url, true))) { - currSite.getElementsByClassName("search")[0].classList.remove("hide") - allSites.getElementsByClassName("search")[0].classList.add("hide") - } else if (wikipediaHelper.redirect(url, true) || (await wikipediaHelper.switchInstance(url, true))) { - currSite.getElementsByClassName("wikipedia")[0].classList.remove("hide") - allSites.getElementsByClassName("wikipedia")[0].classList.add("hide") - } else if (youtubeHelper.redirect(url, "main_frame", false, true) || (await youtubeHelper.switchInstance(url, "main_frame", false, true))) { - currSite.getElementsByClassName("youtube")[0].classList.remove("hide") - allSites.getElementsByClassName("youtube")[0].classList.add("hide") + await getEnabled() + + const currentService = serviceHelper.computeService(url) + if (currentService != null) { + divs[currentService].current.classList.remove("hide") + divs[currentService].all.classList.add("hide") + if (config.services[currentService].preferences != {}) { + const unify = document.getElementById("unify") + const textElement = document.getElementById("unify").getElementsByTagName("h4")[0] + unify.addEventListener("click", () => { + const oldHtml = textElement.innerHTML + textElement.innerHTML = "..." + browser.runtime.sendMessage({ function: "unify" }, response => { + if (response && response.response) textElement.innerHTML = oldHtml + }) + }) } else { - currentSiteIsFrontend.classList.add("hide") + document.getElementById("unify_div").style.display = "none" } - }) - } -) - -document.addEventListener("change", () => { - browser.storage.local.get( - [ - "disableTwitter", - "disableYoutube", - "disableYoutubeMusic", - "disableInstagram", - "disableMaps", - "disableReddit", - "disableSearch", - "translateDisable", - "disableWikipedia", - "disableImgur", - "disableTiktok", - "disableMedium", - "disableQuora", - "disableImdb", - "disableReuters", - "disablePeertubeTargets", - "disableLbryTargets", - "disableSendTarget", - ], - r => { - if (!r.disableTwitter != disableTwitterCurrentSite.checked) - browser.storage.local.set({ - disableTwitter: !disableTwitterCurrentSite.checked, - }) - else if (!r.disableTwitter != disableTwitterAllSites.checked) - browser.storage.local.set({ - disableTwitter: !disableTwitterAllSites.checked, - }) - - if (!r.disableYoutube != disableYoutubeCurrentSite.checked) - browser.storage.local.set({ - disableYoutube: !disableYoutubeCurrentSite.checked, - }) - else if (!r.disableYoutube != disableYoutubeAllSites.checked) - browser.storage.local.set({ - disableYoutube: !disableYoutubeAllSites.checked, - }) - - if (!r.disableYoutubeMusic != disableYoutubeMusicCurrentSite.checked) - browser.storage.local.set({ - disableYoutubeMusic: !disableYoutubeMusicCurrentSite.checked, - }) - else if (!r.disableYoutubeMusic != disableYoutubeMusicAllSites.checked) - browser.storage.local.set({ - disableYoutubeMusic: !disableYoutubeMusicAllSites.checked, - }) - - if (!r.disableInstagram != disableInstagramCurrentSite.checked) - browser.storage.local.set({ - disableInstagram: !disableInstagramCurrentSite.checked, - }) - else if (!r.disableInstagram != disableInstagramAllSites.checked) - browser.storage.local.set({ - disableInstagram: !disableInstagramAllSites.checked, - }) - - if (!r.disableMaps != disableMapsCurrentSite.checked) - browser.storage.local.set({ - disableMaps: !disableMapsCurrentSite.checked, - }) - else if (!r.disableMaps != disableMapsAllSites.checked) - browser.storage.local.set({ - disableMaps: !disableMapsAllSites.checked, - }) - - if (!r.disableReddit != disableRedditCurrentSite.checked) - browser.storage.local.set({ - disableReddit: !disableRedditCurrentSite.checked, - }) - else if (!r.disableReddit != disableRedditAllSites.checked) - browser.storage.local.set({ - disableReddit: !disableRedditAllSites.checked, - }) - - if (!r.disableSearch != disableSearchCurrentSite.checked) - browser.storage.local.set({ - disableSearch: !disableSearchCurrentSite.checked, - }) - else if (!r.disableSearch != disableSearchAllSites.checked) - browser.storage.local.set({ - disableSearch: !disableSearchAllSites.checked, - }) - - if (!r.translateDisable != disableTranslateCurrentSite.checked) - browser.storage.local.set({ - translateDisable: !disableTranslateCurrentSite.checked, - }) - else if (!r.translateDisable != disableTranslateAllSites.checked) - browser.storage.local.set({ - translateDisable: !disableTranslateAllSites.checked, - }) - - if (!r.disableWikipedia != disableWikipediaCurrentSite.checked) - browser.storage.local.set({ - disableWikipedia: !disableWikipediaCurrentSite.checked, - }) - else if (!r.disableWikipedia != disableWikipediaAllSites.checked) - browser.storage.local.set({ - disableWikipedia: !disableWikipediaAllSites.checked, - }) - - if (!r.disableImgur != disableImgurCurrentSite.checked) - browser.storage.local.set({ - disableImgur: !disableImgurCurrentSite.checked, - }) - else if (!r.disableImgur != disableImgurAllSites.checked) - browser.storage.local.set({ - disableImgur: !disableImgurAllSites.checked, - }) - - if (!r.disableTiktok != disableTiktokCurrentSite.checked) - browser.storage.local.set({ - disableTiktok: !disableTiktokCurrentSite.checked, - }) - else if (!r.disableTiktok != disableTiktokAllSites.checked) - browser.storage.local.set({ - disableTiktok: !disableTiktokAllSites.checked, - }) - - if (!r.disableMedium != disableMediumCurrentSite.checked) - browser.storage.local.set({ - disableMedium: !disableMediumCurrentSite.checked, - }) - else if (!r.disableMedium != disableMediumAllSites.checked) - browser.storage.local.set({ - disableMedium: !disableMediumAllSites.checked, - }) - - if (!r.disableQuora != disableQuoraCurrentSite.checked) - browser.storage.local.set({ - disableQuora: !disableQuoraCurrentSite.checked, - }) - else if (!r.disableQuora != disableQuoraAllSites.checked) - browser.storage.local.set({ - disableQuora: !disableQuoraAllSites.checked, - }) - - if (!r.disableImdb != disableImdbCurrentSite.checked) - browser.storage.local.set({ - disableImdb: !disableImdbCurrentSite.checked, - }) - else if (!r.disableImdb != disableImdbAllSites.checked) - browser.storage.local.set({ - disableImdb: !disableImdbAllSites.checked, - }) - - if (!r.disableReuters != disableReutersCurrentSite.checked) - browser.storage.local.set({ - disableReuters: !disableReutersCurrentSite.checked, - }) - else if (!r.disableReuters != disableReutersAllSites.checked) - browser.storage.local.set({ - disableReuters: !disableReutersAllSites.checked, - }) - - if (!r.disablePeertubeTargets != disablePeertubeTargetsCurrentSite.checked) - browser.storage.local.set({ - disablePeertubeTargets: !disablePeertubeTargetsCurrentSite.checked, - }) - else if (!r.disablePeertubeTargets != disablePeertubeTargetsAllSites.checked) - browser.storage.local.set({ - disablePeertubeTargets: !disablePeertubeTargetsAllSites.checked, - }) - - if (!r.disableLbryTargets != disableLbryTargetsCurrentSite.checked) - browser.storage.local.set({ - disableLbryTargets: !disableLbryTargetsCurrentSite.checked, - }) - else if (!r.disableLbryTargets != disableLbryTargetsAllSites.checked) - browser.storage.local.set({ - disableLbryTargets: !disableLbryTargetsAllSites.checked, - }) - - if (!r.disableSendTarget != disableSendTargetsCurrentSite.checked) - browser.storage.local.set({ - disableSendTarget: !disableSendTargetsCurrentSite.checked, - }) - else if (!r.disableSendTarget != disableSendTargetsAllSites.checked) - browser.storage.local.set({ - disableSendTarget: !disableSendTargetsAllSites.checked, - }) + } else { + currentSiteIsFrontend.classList.add("hide") + document.getElementById("unify_div").style.display = "none" } - ) + }) }) +for (const service in config.services) { + divs[service].toggle.all.addEventListener("change", () => { + browser.storage.local.set({ + [service + "Enabled"]: divs[service].toggle.all.checked, + }) + }) + divs[service].toggle.current.addEventListener("change", () => { + browser.storage.local.set({ + [service + "Enabled"]: divs[service].toggle.current.checked, + }) + }) +} + for (const a of document.getElementsByTagName("a")) { a.addEventListener("click", e => { if (!a.classList.contains("prevent")) { diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index 86b9f260..24a02e90 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -7,7 +7,7 @@ <% } else { _%> <%- include ('src/assets/images/' + service + '-icon.svg') %> <% } _%> - <%= service %>
+ <%= config.services[service].name %> <% }; -%>
<%- include ('src/assets/images/about-icon.svg') %>About
-- cgit 1.4.1 From df5e7f9b070066014b9289b5a01adbc91aaf9087 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sat, 24 Sep 2022 11:44:18 +0100 Subject: Made most redirects work as expected --- src/assets/javascripts/services.js | 81 +++++++++++++------------ src/config/config.json | 31 ++++------ src/pages/options/index.html | 107 ++++++++++++++++++++++------------ src/pages/options/widgets/general.ejs | 9 ++- src/pages/popup/popup.js | 8 +-- 5 files changed, 134 insertions(+), 102 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index d3b7290f..64bed3bb 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -27,19 +27,19 @@ function init() { }) for (const service in config.services) { options[service] = {} - browser.storage.local.get([`${utils.camelCase(service)}Enable`, `${service}RedirectType`, `${service}Frontend`], r => { - options[service].enabled = r[utils.camelCase(service) + "Enable"] + browser.storage.local.get([`${service}Enabled`, `${service}RedirectType`, `${service}Frontend`], r => { + options[service].enabled = r[service + "Enabled"] options[service].frontend = r[service + "Frontend"] options[service].redirectType = r[service + "RedirectType"] }) for (const frontend in config.services[service].frontends) { options[frontend] = {} - options[frontend].checks = [] - options[frontend].custom = [] for (const network in config.networks) { + options[frontend][network] = {} + options[frontend][network] = {} browser.storage.local.get([`${frontend}${utils.camelCase(network)}RedirectsChecks`, `${frontend}${utils.camelCase(network)}CustomRedirects`], r => { - options[frontend].checks = r[frontend + utils.camelCase(network) + "RedirectsChecks"] - options[frontend].custom = r[frontend + utils.camelCase(network) + "CustomRedirects"] + options[frontend][network].checks = r[frontend + utils.camelCase(network) + "RedirectsChecks"] + options[frontend][network].custom = r[frontend + utils.camelCase(network) + "CustomRedirects"] }) } } @@ -55,14 +55,22 @@ function all(service) { for (const network in config.networks) { tmp.push(...redirects[frontend][network]) } - } + } else if (config.services[service].frontends[frontend].singleInstance != undefined) tmp.push(config.services[service].frontends[frontend].singleInstance) } return tmp } function regexArray(service, url) { - for (const targetString in config.services[service].targets) { - const target = new RegExp(config.services[service].targets[targetString]) + let targets + if (config.services[service].targets == "datajson") { + browser.storage.local.get(`${service}Targets`, r => { + targets = r[service + "Targets"] + }) + } else { + targets = config.services[service].targets + } + for (const targetString in targets) { + const target = new RegExp(targets[targetString]) if (target.test(url.href)) return true } return false @@ -76,32 +84,30 @@ function redirect(url, type, initiator) { let randomInstance let frontend let network = options.network - let networkFallback = options.networkFallback - let redirectType - if (url.pathname == "/") return for (const service in config.services) { if (!options[service].enabled) continue - let targets = config.services[service].targets - if (targets == "datajson") { - browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) - } + 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") - if (initiator && (all(service).includes(initiator.origin) || targets.includes(initiator.host))) continue - if (!targets.some(rx => rx.test(url.href))) continue - if (type != redirectType && type != "both") continue + if (initiator && (all(service).includes(initiator.origin) || targets.test(initiator.host))) continue + if (!regexArray(service, url)) continue - frontend = options[service].frontend - redirectType = options[service].redirectType - - // browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) + if (Object.keys(config.services[service].frontends).length > 1) { + frontend = options[service].frontend + } else { + frontend = Object.keys(config.services[service].frontends)[0] + } if (config.services[service].frontends[frontend].instanceList) { - let instanceList = [...[frontend + utils.camelCase(network) + "RedirectsChecks"], ...[frontend + utils.camelCase(network) + "CustomRedirects"]] - if (instanceList.length === 0 && networkFallback) instanceList = [...[frontend + "ClearnetRedirectsChecks"], ...[frontend + "ClearnetCustomRedirects"]] - if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return + let instanceList = [...options[frontend][network].checks, ...options[frontend][network].custom] + if (instanceList.length === 0 && options.networkFallback) instanceList = [...options[frontend].clearnet.checks, ...options[frontend].clearnet.custom] + if (instanceList.length === 0) return randomInstance = utils.getRandomInstance(instanceList) - } + } else if (config.services[service].frontends[frontend].singleInstance) randomInstance = config.services[service].frontends[frontend].singleInstance + break } + if (frontend == null) return // Here is a (temperory) space for defining constants required in 2 or more switch cases. // When possible, try have the two switch cases share all their code as done with searx and searxng. @@ -111,10 +117,10 @@ function redirect(url, type, initiator) { const dataLatLngRegex = /!3d(-?[0-9]{1,}.[0-9]{1,})!4d(-?[0-9]{1,}.[0-9]{1,})/ const placeRegex = /\/place\/(.*)\// function convertMapCentre() { - let [, lat, lon, zoom] = 0 + let [lat, lon, zoom] = [null, null, null] if (url.pathname.match(mapCentreRegex)) { // Set map centre if present - ;[, lat, lon, zoom] = url.pathname.match(mapCentreRegex) + ;[lat, lon, zoom] = url.pathname.match(mapCentreRegex) } else if (url.searchParams.has("center")) { ;[lat, lon] = url.searchParams.get("center").split(",") zoom = url.searchParams.get("zoom") ?? "17" @@ -149,7 +155,7 @@ function redirect(url, type, initiator) { case "whoogle": return `${randomInstance}/search${encodeURIComponent(url.searchParams.get("q"))}` case "librex": - return `${randomInstance}/search.php${encodeURIComponent(url.searchParams.get("q"))}` + return `${randomInstance}/search.php?q=${encodeURIComponent(url.searchParams.get("q"))}` case "send": return randomInstance case "nitter": @@ -168,7 +174,7 @@ function redirect(url, type, initiator) { return `${randomInstance}/${url.search}` case "osm": { if (initiator && initiator.host === "earth.google.com") return - travelModes = { + const travelModes = { driving: "fossgis_osrm_car", walking: "fossgis_osrm_foot", bicycling: "fossgis_osrm_bike", @@ -227,10 +233,8 @@ function redirect(url, type, initiator) { let orgVal = url.searchParams.get("origin") let destVal = url.searchParams.get("destination") - let org - addressToLatLng(orgVal, a => (org = a)) - let dest - addressToLatLng(destVal, a => (dest = a)) + let org = addressToLatLng(orgVal) + let dest = addressToLatLng(destVal) prefs.route = `${org};${dest}` let prefsEncoded = new URLSearchParams(prefs).toString() @@ -280,7 +284,7 @@ function redirect(url, type, initiator) { } case "facil": { if (initiator && initiator.host === "earth.google.com") return - let travelModes = { + const travelModes = { driving: "car", walking: "pedestrian", bicycling: "bicycle", @@ -443,17 +447,12 @@ function initDefaults() { function computeService(url) { for (const service in config.services) { - const regex = config.services[service].targets - console.log(regex) if (regexArray(service, url)) { - console.log(service + "gi") return service } else if (all(service).includes(utils.protocolHost(url))) { - console.log(service) return service } } - console.log("moment") return null } diff --git a/src/config/config.json b/src/config/config.json index a4bcf125..84f430fa 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -85,9 +85,8 @@ "instanceList": false } }, - "singleInstanceFrontends": ["freetube", "yatte"], "targets": [ - "^https?:\\/{2}(?:www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api/.*|$)", + "^https?:\\/{2}(?:www\\.|m\\.|)youtube.com(?!iframe_api\\/.*)", "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", "^https?:\\/{2}(?:i|s)\\.ytimg.com\\/vi\\/.*\\/..*", "^https?:\\/{2}(?:www\\.|music\\.|)youtube.com\\/watch?v=..*", @@ -253,7 +252,6 @@ "imgur": { "frontends": { "rimgo": { - "preferences": {}, "name": "rimgo", "instanceList": true } @@ -285,7 +283,6 @@ "medium": { "frontends": { "scribe": { - "preferences": {}, "name": "Scribe", "instanceList": true } @@ -301,14 +298,14 @@ "^psiloveyou\\.xyz", "^entrepreneurshandbook\\.co", "^blog\\.coinbase\\.com", - "^levelup\\.gitconnected\\.com ", - "^javascript\\.plainenglish\\.io ", - "^blog\\.bitsrc\\.io ", - "^itnext\\.io ", - "^codeburst\\.io ", - "^infosecwriteups\\.com ", - "^blog\\.devgenius\\.io ", - "^writingcooperative\\.com " + "^levelup\\.gitconnected\\.com", + "^javascript\\.plainenglish\\.io", + "^blog\\.bitsrc\\.io", + "^itnext\\.io", + "^codeburst\\.io", + "^infosecwriteups\\.com", + "^blog\\.devgenius\\.io", + "^writingcooperative\\.com" ], "name": "Medium", "options": { "enabled": true }, @@ -353,7 +350,6 @@ "reuters": { "frontends": { "neuters": { - "preferences": {}, "name": "Neuters", "instanceList": true } @@ -368,7 +364,6 @@ "peertube": { "frontends": { "simpleertube": { - "preferences": {}, "name": "SimpleerTube", "instanceList": true } @@ -464,13 +459,12 @@ "instanceList": true }, "whoogle": { - "preferences": {}, "name": "Whoogle", "instanceList": true }, "librex": { "preferences": { - "cookies": ["bibliogram", "disable_special", "invidious", "libreddit", "nitter", "proxitok", "theme", "wikiless"] + "cookies": ["bibliogram", "disable_frontends", " disable_special", "invidious", "libreddit", "nitter", "proxitok", "save", "theme", "wikiless"] }, "name": "LibreX", "instanceList": true @@ -516,13 +510,13 @@ "maps": { "frontends": { "facil": { - "preferences": {}, "name": "FacilMap", "instanceList": true }, "osm": { "name": "OpenStreetMap", - "instanceList": false + "instanceList": false, + "singleInstance": "https://www.openstreetmap.org" } }, "targets": ["^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)"], @@ -538,7 +532,6 @@ "sendTargets": { "frontends": { "send": { - "preferences": {}, "name": "Send", "instanceList": "true" } diff --git a/src/pages/options/index.html b/src/pages/options/index.html index b6ea1535..20592637 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -180,110 +180,145 @@ @@ -318,7 +318,7 @@ - Send Files + diff --git a/src/pages/options/widgets/general.ejs b/src/pages/options/widgets/general.ejs index 77028ac2..e24046db 100644 --- a/src/pages/options/widgets/general.ejs +++ b/src/pages/options/widgets/general.ejs @@ -92,7 +92,7 @@ <% } else { _%> <%- include ('src/assets/images/' + service + '-icon.svg') %> <% } _%> - <%= config.services[service].name %> + -- cgit 1.4.1 From d980c4c70e835488721666996e2408801eea4970 Mon Sep 17 00:00:00 2001 From: Woodpecker CI Date: Tue, 4 Oct 2022 00:09:57 +0000 Subject: updated instances --- src/instances/blacklist.json | 4 ++++ src/instances/data.json | 42 ++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 79cdc94f..cbbb3b24 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -71,13 +71,16 @@ "offline": [ "https://invidious.rhyshl.live", "https://invidious.esmailelbob.xyz", + "https://cringe.whatever.social", "https://proxitok.odyssey346.dev", "https://nhanh.cloud", "https://nitter.winscloud.net", "https://ntr.odyssey346.dev", "https://libreddit.winscloud.net", "https://teddit.ggc-project.de", + "https://teddit.tokhmi.xyz", "https://quetre.odyssey346.dev", + "https://translate.northboot.xyz", "https://st.odyssey346.dev", "https://jsearch.pw", "https://searx.gnu.style", @@ -91,6 +94,7 @@ "https://search.wef.lol", "https://i.bcow.xyz", "https://i.actionsack.com", + "https://rimgo.mha.fi", "https://lbry.bcow.xyz", "https://beatbump.ml" ] diff --git a/src/instances/data.json b/src/instances/data.json index 41a43bcd..3a8e721d 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -10,7 +10,6 @@ "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.sethforprivacy.com", - "https://invidious.tiekoetter.com", "https://invidious.flokinet.to", "https://inv.bp.projectsegfau.lt", "https://inv.vern.cc", @@ -21,6 +20,7 @@ "https://invidious.slipfox.xyz", "https://invidious.esmailelbob.xyz", "https://youtube.076.ne.jp", + "https://invidious.tiekoetter.com", "https://invidious.namazso.eu" ], "tor": [ @@ -210,7 +210,8 @@ "https://nitter.d420.de", "https://nitter.caioalonso.com", "https://nitter.at", - "https://nitter.drivet.xyz" + "https://nitter.drivet.xyz", + "https://nitter.pw" ], "tor": [ "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -509,11 +510,13 @@ "https://search.stinpriza.org", "https://search.trom.tf", "https://searx.bissisoft.com", + "https://searx.chocoflan.net", "https://searx.divided-by-zero.eu", "https://searx.dresden.network", "https://searx.fossencdi.org", "https://searx.gnu.style", "https://searx.mastodontech.de", + "https://searx.mistli.net", "https://searx.mxchange.org", "https://searx.nakhan.net", "https://searx.netzspielplatz.de", @@ -540,11 +543,15 @@ ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", + "http://b2c7fvbhnfvwnl6oh2tydhzfx4i37kmmrycq42heqbbe7wovq3uzenid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" + "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion", + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", + "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion", + "http://lgmekfnpealdqhnctyg3p5fuelpdwnbqbwnl2ickpdoodzatzgz27ryd.onion" ], "i2p": [ "http://ransack.i2p", @@ -567,6 +574,7 @@ "https://priv.au", "https://privatus.live", "https://s.frlt.one", + "https://s.trung.fun", "https://s.zhaocloud.net", "https://saber.tk", "https://search.0relay.com", @@ -597,7 +605,6 @@ "https://searx.baczek.me", "https://searx.be", "https://searx.becomesovran.com", - "https://searx.chocoflan.net", "https://searx.ebnar.xyz", "https://searx.ericaftereric.top", "https://searx.esmailelbob.xyz", @@ -606,7 +613,6 @@ "https://searx.gnous.eu", "https://searx.kujonello.cf", "https://searx.mha.fi", - "https://searx.mistli.net", "https://searx.namejeff.xyz", "https://searx.org", "https://searx.orion-hub.fr", @@ -639,16 +645,12 @@ "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", - "http://b2c7fvbhnfvwnl6oh2tydhzfx4i37kmmrycq42heqbbe7wovq3uzenid.onion", "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", - "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", - "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", - "http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion", - "https://lgmekfnpealdqhnctyg3p5fuelpdwnbqbwnl2ickpdoodzatzgz27ryd.onion" + "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion" ], "i2p": [], "loki": [] @@ -677,19 +679,23 @@ "normal": [ "https://librex.beparanoid.de", "https://librex.extravi.dev", + "https://lx.vern.cc", "https://search.davidovski.xyz", "https://librex.kitscomputer.tk", "https://search.funami.tech", "https://librex.catalyst.sx", "https://search.madreyk.xyz", - "https://search.pabloferreiro.es" + "https://search.pabloferreiro.es", + "https://buscar.weblibre.org" ], "tor": [ "http://librex.2356uhnbpv5nk3bni5bv6jg2cd6lgj664kwx3lhyelstpttpyv4kk2qd.onion", - "http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion" + "http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion", + "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" ], "i2p": [ - "http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p" + "http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p", + "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p" ], "loki": [] }, @@ -790,6 +796,7 @@ "loki": [] }, "peertube": [ + "https://tbh.co-shaoghal.net", "https://tube.kansanvalta.org", "https://duanrra.cf", "https://ytube.retronerd.at", @@ -928,13 +935,11 @@ "https://videos.tormentasolar.win", "https://tube.nestor.coop", "https://live.oldskool.fi", - "https://dytube.com", "https://tube.thierrytalbert.fr", "https://peertube.informaction.info", "https://tube.ac-amiens.fr", "https://tube.alado.space", "https://tube.network.europa.eu", - "https://vnchich.com", "https://pt.maciej.website", "https://peertube.frontmediatique.fr", "https://peertube.bgzashtita.es", @@ -966,7 +971,6 @@ "https://pierre.tube", "https://mirametube.fr", "https://vidz.dou.bet", - "https://videos.redeyes.site", "https://video.hostpath.de", "https://free-streams.com", "https://tube.pawelko.net", @@ -1127,7 +1131,6 @@ "https://www.orion-hub.fr", "https://tv.orion-serv.fr", "https://video.interru.io", - "https://tube.cnr.it", "https://peertube.dtmf.ca", "https://tube.ponsonaille.fr", "https://tube.int5.net", @@ -1146,7 +1149,6 @@ "https://vtr.chikichiki.tube", "https://fedimovie.com", "https://tube.doctors4covidethics.org", - "https://yoba.tv", "https://tube.mediainformationcenter.de", "https://peertube.communecter.org", "https://queermotion.org", @@ -1408,7 +1410,6 @@ "https://videos.john-livingston.fr", "https://melsungen.peertube-host.de", "https://evangelisch.video", - "https://tube.anufrij.de", "https://videos.mastodont.cat", "https://media.undeadnetwork.de", "https://tube.dragonpsi.xyz", @@ -1460,7 +1461,6 @@ "https://kodcast.com", "https://video.altertek.org", "https://ruraletv.ovh", - "https://videos.weblib.re", "https://tube.oisux.org", "https://peertube.louisematic.site", "https://clap.nerv-project.eu", @@ -1501,14 +1501,12 @@ "https://tube.nox-rhea.org", "https://peertube.securitymadein.lu", "https://tube.rita.moe", - "https://tuktube.com", "https://mytube.kn-cloud.de", "https://tube.nuagelibre.fr", "https://video.nogafam.es", "https://peertube.stream", "https://videos.leslionsfloorball.fr", "https://player.ojamajo.moe", - "https://ftsi.ru", "https://video.cigliola.com", "https://xxx.noho.st", "https://peertube.stefofficiel.me", -- cgit 1.4.1 From e4954d197fee859112381040b1d8f3ba8009df56 Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 4 Oct 2022 17:36:38 +0100 Subject: Display if server is not found, made images in settings clickable --- src/assets/javascripts/utils.js | 4 +- src/pages/options/index.html | 88 ++++++++++++++++++++++++++++++----------- src/pages/widgets/links.ejs | 16 ++++++-- 3 files changed, 82 insertions(+), 26 deletions(-) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 056bbc00..9ae9123f 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -112,10 +112,11 @@ async function processDefaultCustomInstances(service, frontend, network, documen const offline = offlineBlackList.includes(x) ? ' offline' : "" let ms = instancesLatency[x] - let latencyColor = ms <= 1000 ? "green" : ms <= 2000 ? "orange" : "red" + let latencyColor = ms == -1 ? "red" : ms <= 1000 ? "green" : ms <= 2000 ? "orange" : "red" let latencyLimit if (ms == 5000) latencyLimit = "5000ms+" else if (ms > 5000) latencyLimit = `ERROR: ${ms - 5000}` + else if (ms == -1) latencyLimit = "Server not found" else latencyLimit = ms + "ms" const latency = x in instancesLatency ? '' + latencyLimit + "" : "" @@ -267,6 +268,7 @@ async function testLatency(element, instances, frontend) { else text = `${time}ms` element.innerHTML = `${href}: ${text}` } else { + myList[href] = -1 color = "red" element.innerHTML = `${href}: Server not found` if (options[frontend].clearnet.enabled.includes(href)) options[frontend].clearnet.enabled.splice(options[frontend].clearnet.enabled.indexOf(href), 1) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index a3afec55..53ee562e 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -10,85 +10,129 @@
diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index 6fa9514c..2373a101 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -1,13 +1,23 @@
<% }; -%> -
<%- include ('src/assets/images/about-icon.svg') %>About
+ -- cgit 1.4.1 From c87bbba349ced5cbc5d9559fbf8af88f9557ad24 Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 4 Oct 2022 19:10:07 +0100 Subject: Ported 87d68cb662 --- .woodpecker/instances.yml | 9 +- README.md | 4 +- src/assets/javascripts/frontend.js | 143 ----------------- src/assets/javascripts/services.js | 18 ++- src/pages/background/background.js | 314 ++++--------------------------------- 5 files changed, 54 insertions(+), 434 deletions(-) delete mode 100644 src/assets/javascripts/frontend.js diff --git a/.woodpecker/instances.yml b/.woodpecker/instances.yml index 72fdd6e7..43df0cd9 100644 --- a/.woodpecker/instances.yml +++ b/.woodpecker/instances.yml @@ -8,13 +8,14 @@ pipeline: - python -m pip install --upgrade pip - pip install requests colorama - python src/instances/get_instances.py + # SSH configuration + - mkdir ~/.ssh + - ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts + - eval `ssh-agent` + - echo "$TOKEN" | tr -d '\r' | ssh-add - # Git configuration - git config --global user.email $MAIL - git config --global user.name "Woodpecker CI" - git commit -am "updated instances" - - mkdir ~/.ssh - - ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts - git remote set-url origin git@codeberg.org:libredirect/libredirect.git - - eval `ssh-agent` - - echo "$TOKEN" | tr -d '\r' | ssh-add - - git push --set-upstream origin master diff --git a/README.md b/README.md index d55dd37b..8c5d6080 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Send Files => [Send](https://gitlab.com/timvisee/send) **Note**: The Extension will be using random instances by default. You can modify this and add custom instances too. -# Please read the [FAQ](https://libredirect.github.io/faq.html) if you have any questions! +# Please read the [FAQ](https://libredirect.codeberg.page/faq.html) if you have any questions! ## Donate @@ -69,7 +69,7 @@ npm update npm install ``` -If you are modifying any files ending with .ejs, you need to run the following command to render html: +If you are modifying `config.json` or any files ending with .ejs, you need to run the following command to render html: ``` npm run ejs diff --git a/src/assets/javascripts/frontend.js b/src/assets/javascripts/frontend.js deleted file mode 100644 index ab71cc0d..00000000 --- a/src/assets/javascripts/frontend.js +++ /dev/null @@ -1,143 +0,0 @@ -class FrontEnd { - constructor({ enable, frontends, frontend, redirect }) { - this.redirects = {} - this.enable = enable - this.frontend = frontend - this.protocol = "normal" - this.protocolFallback = true - fetch("/instances/data.json") - .then(response => response.text()) - .then(async data => { - data = JSON.parse(data) - fetch("/instances/blacklist.json") - .then(response => response.text()) - .then(async blackList => { - blackList = JSON.parse(blackList) - for (const frontend in frontends) { - this.redirects[frontend] = {} - - this.redirects[frontend].cookies = [...frontends[frontend].cookies] - - for (const protocol in data[frontend]) { - this.redirects[frontend][protocol] = {} - - this.redirects[frontend][protocol].all = [...data[frontend][protocol]] - - this.redirects[frontend][protocol].custom = [] - - this.redirects[frontend][protocol].checked = [...data[frontend][protocol]] - for (const instance of blackList.cloudflare) { - const a = this.redirects[frontend][protocol].checked.indexOf(instance) - if (a > -1) this.redirects[frontend][protocol].checked.splice(a, 1) - } - for (const instance of blackList.offline) { - const a = this.redirects[frontend][protocol].checked.indexOf(instance) - if (a > -1) this.redirects[frontend][protocol].checked.splice(a, 1) - } - } - } - }) - }) - this.unifyCookies = from => - new Promise(async resolve => { - await init() - const protocolHost = utils.protocolHost(from) - const list = [...this.redirects[this.frontend][this.protocol]] - if (![...list.checked, ...list.custom].includes(protocolHost)) { - resolve() - return - } - for (const cookie of this.redirects[this.frontend].cookies) { - await utils.copyCookie(frontend, protocolHost, [...list.checked, list.custom], cookie) - } - resolve(true) - }) - - this.switchInstance = (url, disableOverride) => { - if (!this.enable && !disableOverride) return - - const protocolHost = utils.protocolHost(url) - - const list = [...this.redirects[this.frontend][this.protocol]] - if (!list.all.includes(protocolHost)) return - - let userList = [...list.checked, ...list.custom] - if (userList.length === 0 && this.protocolFallback) userList = [...list.normal.all] - - const i = userList.indexOf(protocolHost) - if (i > -1) userList.splice(i, 1) - if (userList.length === 0) return - - const randomInstance = utils.getRandomInstance(userList) - return `${randomInstance}${url.pathname}${url.search}` - } - - this.redirect = (url, type, initiator, disableOverride) => { - const result = redirect(url, type, initiator, disableOverride) - if (result == "BYPASSTAB") return "BYPASSTAB" - if (result) { - const list = [...this.redirects[this.frontend][this.protocol]] - let userList = [...list.checked, ...list.custom] - const randomInstance = utils.getRandomInstance(userList) - return `${randomInstance}${result.pathname}${result.search}` - } - } - - let init = () => new Promise(async resolve => {}) - } -} - -let Reddit = new FrontEnd({ - enable: true, - frontends: { - libreddit: { cookies: ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] }, - teddit: { - cookies: [ - "collapse_child_comments", - "domain_instagram", - "domain_twitter", - "domain_youtube", - "flairs", - "highlight_controversial", - "nsfw_enabled", - "post_media_max_height", - "show_upvoted_percentage", - "show_upvotes", - "theme", - "videos_muted", - ], - }, - }, - frontend: "libreddit", - redirect: (url, type, initiator, disableOverride) => { - if (this.enable && !disableOverride) return - - const targets = [/^https?:\/{2}(www\.|old\.|np\.|new\.|amp\.|)reddit\.com/, /^https?:\/{2}(i\.|preview\.)redd\.it/] - if (!targets.some(rx => rx.test(url.href))) return - - if (initiator && all().includes(initiator.origin)) return "BYPASSTAB" - if (!["main_frame", "xmlhttprequest", "other", "image", "media"].includes(type)) return - - const bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/ - if (url.pathname.match(bypassPaths)) return - - const protocolHost = utils.protocolHost(url) - - if (url.host === "i.redd.it") { - if (this.frontend == "libreddit") return `${protocolHost}/img${url.pathname}${url.search}` - if (this.frontend == "teddit") return `${protocolHost}/pics/w:null_${url.pathname.substring(1)}${url.search}` - } else if (url.host === "redd.it") { - // https://redd.it/foo => https://libredd.it/comments/foo - if (this.frontend == "libreddit" && !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)) return `${protocolHost}/comments${url.pathname}${url.search}` - // https://redd.it/foo => https://teddit.net/comments/foo - if (this.frontend == "teddit" && !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)) return `${protocolHost}/comments${url.pathname}${url.search}` - } else if (url.host === "preview.redd.it") { - if (this.frontend == "libreddit") return `${protocolHost}/preview/pre${url.pathname}${url.search}` - if (this.frontend == "teddit") return - } else { - return `${url.href}` - } - }, -}) - -export default {} diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index afd7906f..eed1e6c6 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -140,13 +140,23 @@ function redirect(url, type, initiator) { case "send": return randomInstance case "nitter": + let search = new URLSearchParams(url.search) + + search.delete("ref_src") + search.delete("ref_url") + + search = search.toString() + if (search !== "") search = `?${search}` + if (url.host.split(".")[0] === "pbs" || url.host.split(".")[0] === "video") { const [, id, format, extra] = url.search.match(/(.*)\?format=(.*)&(.*)/) const query = encodeURIComponent(`${id}.${format}?${extra}`) - return `${randomInstance}/pic${url.pathname}${query}` - } else if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${url.search}` - else if (url.host == "t.co") return `${randomInstance}/t.co${url.pathname}` - else return `${randomInstance}${url.pathname}${url.search}` + return `${randomInstance}/pic${search}${query}` + } + + if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${search}` + if (url.host == "t.co") return `${randomInstance}/t.co${url.pathname}` + return `${randomInstance}${url.pathname}${search}` case "yattee": return url.href.replace(/^https?:\/{2}/, "yattee://") case "freetube": diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 7186144b..cad08580 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -1,68 +1,25 @@ -<<<<<<< HEAD "use strict" import generalHelper from "../../assets/javascripts/general.js" import utils from "../../assets/javascripts/utils.js" - -import youtubeHelper from "../../assets/javascripts/youtube/youtube.js" -import youtubeMusicHelper from "../../assets/javascripts/youtubeMusic.js" -import twitterHelper from "../../assets/javascripts/twitter.js" -import instagramHelper from "../../assets/javascripts/instagram.js" -import redditHelper from "../../assets/javascripts/reddit.js" -import searchHelper from "../../assets/javascripts/search.js" -import translateHelper from "../../assets/javascripts/translate/translate.js" -import mapsHelper from "../../assets/javascripts/maps.js" -import wikipediaHelper from "../../assets/javascripts/wikipedia.js" -import mediumHelper from "../../assets/javascripts/medium.js" -import quoraHelper from "../../assets/javascripts/quora.js" -import libremdbHelper from "../../assets/javascripts/imdb.js" -import reutersHelper from "../../assets/javascripts/reuters.js" -import imgurHelper from "../../assets/javascripts/imgur.js" -import tiktokHelper from "../../assets/javascripts/tiktok.js" -import sendTargetsHelper from "../../assets/javascripts/sendTargets.js" -import peertubeHelper from "../../assets/javascripts/peertube.js" -import lbryHelper from "../../assets/javascripts/lbry.js" - -import frontend from "../../assets/javascripts/frontend.js" +import servicesHelper from "../../assets/javascripts/services.js" window.browser = window.browser || window.chrome -browser.runtime.onInstalled.addListener(details => { - function initDefaults() { +function initDefaults() { + browser.storage.local.clear(() => { fetch("/instances/blacklist.json") .then(response => response.text()) .then(async data => { - browser.storage.local.clear(() => { - browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { - browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, () => { - browser.storage.local.set({ offlineBlackList: JSON.parse(data).offline }, () => { - generalHelper.initDefaults() - youtubeHelper.initDefaults() - youtubeMusicHelper.initDefaults() - twitterHelper.initDefaults() - instagramHelper.initDefaults() - mapsHelper.initDefaults() - searchHelper.initDefaults() - translateHelper.initDefaults() - mediumHelper.initDefaults() - quoraHelper.initDefaults() - libremdbHelper.initDefaults() - reutersHelper.initDefaults() - redditHelper.initDefaults() - wikipediaHelper.initDefaults() - imgurHelper.initDefaults() - tiktokHelper.initDefaults() - sendTargetsHelper.initDefaults() - peertubeHelper.initDefaults() - lbryHelper.initDefaults() - }) - }) - }) + browser.storage.local.set({ blacklists: JSON.parse(data) }, async () => { + await generalHelper.initDefaults() + await servicesHelper.initDefaults() }) }) - } - if (details.reason == "install") initDefaults() + }) +} +browser.runtime.onInstalled.addListener(details => { // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { // if (details.reason == "update") // browser.storage.local.get(null, r => { @@ -74,6 +31,25 @@ browser.runtime.onInstalled.addListener(details => { // }) // else initDefaults(); // } + 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.1": + await generalHelper.initDefaults() + await servicesHelper.initDefaults() + await servicesHelper.upgradeOptions() + break + } + }) + }) + } }) let BYPASSTABs = [] @@ -89,24 +65,7 @@ browser.webRequest.onBeforeRequest.addListener( return null } - let newUrl = youtubeMusicHelper.redirect(url, details.type) - if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, details.tabId, initiator) - if (!newUrl) newUrl = twitterHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = instagramHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = mapsHelper.redirect(url, initiator) - if (!newUrl) newUrl = redditHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = mediumHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = quoraHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = libremdbHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = reutersHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = imgurHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = tiktokHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = sendTargetsHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = peertubeHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = lbryHelper.redirect(url, details.type, initiator) - if (!newUrl) newUrl = translateHelper.redirect(url) - if (!newUrl) newUrl = searchHelper.redirect(url) - if (!newUrl) newUrl = wikipediaHelper.redirect(url) + let newUrl = servicesHelper.redirect(url, details.type, initiator) if (details.frameAncestors && details.frameAncestors.length > 0 && generalHelper.isException(new URL(details.frameAncestors[0].url))) newUrl = null @@ -140,6 +99,7 @@ browser.tabs.onRemoved.addListener(tabId => { } }) +/* browser.webRequest.onHeadersReceived.addListener( e => { let response = youtubeHelper.removeXFrameOptions(e) @@ -149,23 +109,10 @@ browser.webRequest.onHeadersReceived.addListener( { urls: [""] }, ["blocking", "responseHeaders"] ) +*/ async function redirectOfflineInstance(url, tabId) { - let newUrl = await youtubeHelper.switchInstance(url, true) - if (!newUrl) newUrl = await twitterHelper.switchInstance(url, true) - if (!newUrl) newUrl = await instagramHelper.switchInstance(url, true) - if (!newUrl) newUrl = await redditHelper.switchInstance(url, true) - if (!newUrl) newUrl = await searchHelper.switchInstance(url, true) - if (!newUrl) newUrl = await translateHelper.switchInstance(url, true) - if (!newUrl) newUrl = await mediumHelper.switchInstance(url, true) - if (!newUrl) newUrl = await quoraHelper.switchInstance(url, true) - if (!newUrl) newUrl = await libremdbHelper.switchInstance(url, true) - if (!newUrl) newUrl = await tiktokHelper.switchInstance(url, true) - if (!newUrl) newUrl = await imgurHelper.switchInstance(url, true) - if (!newUrl) newUrl = await wikipediaHelper.switchInstance(url, true) - if (!newUrl) newUrl = await peertubeHelper.switchInstance(url, true) - if (!newUrl) newUrl = await lbryHelper.switchInstance(url, true) - if (!newUrl) newUrl = await youtubeMusicHelper.switchInstance(url, true) + let newUrl = await servicesHelper.switchInstance(url, true) if (newUrl) { if (counter >= 5) { @@ -182,7 +129,7 @@ async function redirectOfflineInstance(url, tabId) { let counter = 0 function isAutoRedirect() { - return new Promise(resolve => browser.storage.local.get("autoRedirect", r => resolve(r.autoRedirect == true))) + return new Promise(resolve => browser.storage.local.get("options", r => resolve(r.options.autoRedirect == true))) } browser.webRequest.onResponseStarted.addListener( @@ -242,198 +189,3 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => { if (message.function === "unify") utils.unify(false).then(r => sendResponse({ response: r })) return true }) - -browser.storage.local.set({ version: browser.runtime.getManifest().version }) -======= -"use strict" - -import generalHelper from "../../assets/javascripts/general.js" -import utils from "../../assets/javascripts/utils.js" -import servicesHelper from "../../assets/javascripts/services.js" - -window.browser = window.browser || window.chrome - -function initDefaults() { - browser.storage.local.clear(() => { - 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() - }) - }) - }) -} - -browser.runtime.onInstalled.addListener(details => { - // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { - // if (details.reason == "update") - // browser.storage.local.get(null, r => { - // if (r.theme) { - // const old = encodeURIComponent(JSON.stringify(r)) - // browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) }); - // } - // initDefaults(); - // }) - // else initDefaults(); - // } - switch (details.reason) { - case "install": - initDefaults() - 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.1": - await generalHelper.initDefaults() - await servicesHelper.initDefaults() - await servicesHelper.upgradeOptions() - break - } - }) - }) - } -}) - -let BYPASSTABs = [] -browser.webRequest.onBeforeRequest.addListener( - details => { - const url = new URL(details.url) - if (new RegExp(/^chrome-extension:\/{2}.*\/instances\/.*.json$/).test(url.href) && details.type == "xmlhttprequest") return - let initiator - try { - if (details.originUrl) initiator = new URL(details.originUrl) - else if (details.initiator) initiator = new URL(details.initiator) - } catch { - return null - } - - let newUrl = servicesHelper.redirect(url, details.type, initiator) - - 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 - } - console.info("Redirecting", url.href, "=>", newUrl) - return { redirectUrl: newUrl } - } - return null - }, - { urls: [""] }, - ["blocking"] -) - -browser.tabs.onRemoved.addListener(tabId => { - const i = BYPASSTABs.indexOf(tabId) - if (i > -1) { - BYPASSTABs.splice(i, 1) - console.log("Removed BYPASSTABs", 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) - - if (newUrl) { - if (counter >= 5) { - browser.tabs.update(tabId, { - url: `/pages/errors/instance_offline.html?url=${encodeURIComponent(newUrl)}`, - }) - counter = 0 - } else { - browser.tabs.update(tabId, { url: newUrl }) - counter++ - } - } -} -let counter = 0 - -function isAutoRedirect() { - return new Promise(resolve => browser.storage.local.get("options", r => resolve(r.options.autoRedirect == true))) -} - -browser.webRequest.onResponseStarted.addListener( - async details => { - if (!(await isAutoRedirect())) return null - if (details.type == "main_frame" && details.statusCode >= 500) redirectOfflineInstance(new URL(details.url), details.tabId) - }, - { urls: [""] } -) - -browser.webRequest.onErrorOccurred.addListener( - async details => { - if (!(await isAutoRedirect())) return - if (details.type == "main_frame") redirectOfflineInstance(new URL(details.url), details.tabId) - }, - { urls: [""] } -) - -browser.commands.onCommand.addListener(command => { - if (command === "switchInstance") utils.switchInstance() - else if (command == "copyRaw") utils.copyRaw() - else if (command == "unify") utils.unify() -}) - -browser.contextMenus.create({ - id: "settings", - title: browser.i18n.getMessage("Settings"), - contexts: ["browser_action"], -}) - -browser.contextMenus.create({ - id: "switchInstance", - title: browser.i18n.getMessage("switchInstance"), - contexts: ["browser_action"], -}) - -browser.contextMenus.create({ - id: "copyRaw", - title: browser.i18n.getMessage("copyRaw"), - contexts: ["browser_action"], -}) - -browser.contextMenus.create({ - id: "unify", - title: browser.i18n.getMessage("unifySettings"), - 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.runtime.onMessage.addListener((message, sender, sendResponse) => { - if (message.function === "unify") utils.unify(false).then(r => sendResponse({ response: r })) - return true -}) ->>>>>>> optimizations -- cgit 1.4.1 From 1898a17f0468e34c94f10fa829d5f1d04a360fdb Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 4 Oct 2022 21:33:53 +0100 Subject: Restored utils.js --- src/assets/javascripts/utils.js | 455 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 455 insertions(+) create mode 100644 src/assets/javascripts/utils.js diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js new file mode 100644 index 00000000..9ae9123f --- /dev/null +++ b/src/assets/javascripts/utils.js @@ -0,0 +1,455 @@ +window.browser = window.browser || window.chrome + +import localise from "./localise.js" +import servicesHelper from "./services.js" + +function getRandomInstance(instances) { + return instances[~~(instances.length * Math.random())] +} + +function camelCase(str) { + return str.charAt(0).toUpperCase() + str.slice(1) +} + +let cloudflareBlackList = [] +let authenticateBlackList = [] +let offlineBlackList = [] +async function initBlackList() { + return new Promise(resolve => { + fetch("/instances/blacklist.json") + .then(response => response.text()) + .then(data => { + cloudflareBlackList = JSON.parse(data).cloudflare + authenticateBlackList = JSON.parse(data).authenticate + offlineBlackList = JSON.parse(data).offline + resolve() + }) + }) +} + +function updateInstances() { + return new Promise(async resolve => { + let http = new XMLHttpRequest() + let fallback = new XMLHttpRequest() + http.open("GET", "https://codeberg.org/LibRedirect/libredirect/raw/branch/master/src/instances/data.json", false) + http.send(null) + if (http.status != 200) { + fallback.open("GET", "https://raw.githubusercontent.com/libredirect/libredirect/master/src/instances/data.json", false) + fallback.send(null) + if (fallback.status === 200) { + http = fallback + } else { + resolve() + return + } + } + await initBlackList() + const instances = JSON.parse(http.responseText) + + servicesHelper.setRedirects(instances) + + console.info("Successfully updated Instances") + resolve(true) + return + }) +} + +function protocolHost(url) { + if (url.username && url.password) return `${url.protocol}//${url.username}:${url.password}@${url.host}` + return `${url.protocol}//${url.host}` +} + +async function processDefaultCustomInstances(service, frontend, network, document) { + let instancesLatency + let frontendNetworkElement = document.getElementById(frontend).getElementsByClassName(network)[0] + + let frontendCustomInstances = [] + let frontendCheckListElement = frontendNetworkElement.getElementsByClassName("checklist")[0] + + await initBlackList() + + let frontendDefaultRedirects + + let redirects, options + + async function getFromStorage() { + return new Promise(async resolve => + browser.storage.local.get(["options", "redirects", "latency"], r => { + frontendDefaultRedirects = r.options[frontend][network].enabled + frontendCustomInstances = r.options[frontend][network].custom + options = r.options + instancesLatency = r.latency[frontend] ?? [] + redirects = r.redirects + resolve() + }) + ) + } + + await getFromStorage() + + function calcFrontendCheckBoxes() { + let isTrue = true + for (const item of redirects[frontend][network]) { + if (!frontendDefaultRedirects.includes(item)) { + isTrue = false + break + } + } + for (const element of frontendCheckListElement.getElementsByTagName("input")) { + element.checked = frontendDefaultRedirects.includes(element.className) + } + if (frontendDefaultRedirects.length == 0) isTrue = false + frontendNetworkElement.getElementsByClassName("toggle-all")[0].checked = isTrue + } + frontendCheckListElement.innerHTML = [ + `
+ Toggle All + +
`, + ...redirects[frontend][network].map(x => { + const cloudflare = cloudflareBlackList.includes(x) ? ' cloudflare' : "" + const authenticate = authenticateBlackList.includes(x) ? ' authenticate' : "" + const offline = offlineBlackList.includes(x) ? ' offline' : "" + + let ms = instancesLatency[x] + let latencyColor = ms == -1 ? "red" : ms <= 1000 ? "green" : ms <= 2000 ? "orange" : "red" + let latencyLimit + if (ms == 5000) latencyLimit = "5000ms+" + else if (ms > 5000) latencyLimit = `ERROR: ${ms - 5000}` + else if (ms == -1) latencyLimit = "Server not found" + else latencyLimit = ms + "ms" + + const latency = x in instancesLatency ? '' + latencyLimit + "" : "" + + let warnings = [cloudflare, authenticate, offline, latency].join(" ") + return `
+ ${x}${warnings} + +
` + }), + ].join("\n
\n") + + localise.localisePage() + + calcFrontendCheckBoxes() + frontendNetworkElement.getElementsByClassName("toggle-all")[0].addEventListener("change", async event => { + if (event.target.checked) frontendDefaultRedirects = [...redirects[frontend][network]] + else frontendDefaultRedirects = [] + + options[frontend][network].enabled = frontendDefaultRedirects + browser.storage.local.set({ options }) + calcFrontendCheckBoxes() + }) + + for (let element of frontendCheckListElement.getElementsByTagName("input")) { + if (element.className != "toggle-all") + frontendNetworkElement.getElementsByClassName(element.className)[0].addEventListener("change", async event => { + if (event.target.checked) frontendDefaultRedirects.push(element.className) + else { + let index = frontendDefaultRedirects.indexOf(element.className) + if (index > -1) frontendDefaultRedirects.splice(index, 1) + } + + options[frontend][network].enabled = frontendDefaultRedirects + browser.storage.local.set({ options }) + calcFrontendCheckBoxes() + }) + } + + function calcFrontendCustomInstances() { + frontendNetworkElement.getElementsByClassName("custom-checklist")[0].innerHTML = frontendCustomInstances + .map( + x => `
+ ${x} + +
+
` + ) + .join("\n") + + for (const item of frontendCustomInstances) { + frontendNetworkElement.getElementsByClassName(`clear-${item}`)[0].addEventListener("click", async () => { + let index = frontendCustomInstances.indexOf(item) + if (index > -1) frontendCustomInstances.splice(index, 1) + options[frontend][network].custom = frontendCustomInstances + browser.storage.local.set({ options }) + calcFrontendCustomInstances() + }) + } + } + calcFrontendCustomInstances() + frontendNetworkElement.getElementsByClassName("custom-instance-form")[0].addEventListener("submit", async event => { + event.preventDefault() + let frontendCustomInstanceInput = frontendNetworkElement.getElementsByClassName("custom-instance")[0] + let url = new URL(frontendCustomInstanceInput.value) + let protocolHostVar = protocolHost(url) + if (frontendCustomInstanceInput.validity.valid && !redirects[frontend][network].includes(protocolHostVar)) { + if (!frontendCustomInstances.includes(protocolHostVar)) { + frontendCustomInstances.push(protocolHostVar) + options[frontend][network].custom = frontendCustomInstances + browser.storage.local.set({ options }) + frontendCustomInstanceInput.value = "" + } + calcFrontendCustomInstances() + } + }) +} + +function ping(href) { + return new Promise(async resolve => { + let average = 0 + let time + for (let i = 0; i < 3; i++) { + time = await pingOnce(href) + if (i == 0) continue + if (time >= 5000) { + resolve(time) + return + } + average += time + } + average = parseInt(average / 3) + resolve(average) + }) +} + +function pingOnce(href) { + return new Promise(async resolve => { + let started + let http = new XMLHttpRequest() + http.timeout = 5000 + http.ontimeout = () => resolve(5000) + http.onerror = () => resolve() + http.onreadystatechange = () => { + if (http.readyState == 2) { + if (http.status == 200) { + let ended = new Date().getTime() + http.abort() + resolve(ended - started) + } else { + resolve(5000 + http.status) + } + } + } + http.open("GET", `${href}?_=${new Date().getTime()}`, true) + started = new Date().getTime() + http.send(null) + }) +} + +async function testLatency(element, instances, frontend) { + return new Promise(async resolve => { + let myList = {} + let latencyThreshold, options + browser.storage.local.get(["options"], r => { + latencyThreshold = r.options.latencyThreshold + options = r.options + }) + for (const href of instances) { + await ping(href).then(time => { + let color + if (time) { + myList[href] = time + if (time <= 1000) color = "green" + else if (time <= 2000) color = "orange" + else color = "red" + + if (time > latencyThreshold && options[frontend].clearnet.enabled.includes(href)) { + options[frontend].clearnet.enabled.splice(options[frontend].clearnet.enabled.indexOf(href), 1) + } + + let text + if (time == 5000) text = "5000ms+" + else if (time > 5000) text = `ERROR: ${time - 5000}` + else text = `${time}ms` + element.innerHTML = `${href}: ${text}` + } else { + myList[href] = -1 + color = "red" + element.innerHTML = `${href}: Server not found` + if (options[frontend].clearnet.enabled.includes(href)) options[frontend].clearnet.enabled.splice(options[frontend].clearnet.enabled.indexOf(href), 1) + } + }) + } + browser.storage.local.set({ options }) + resolve(myList) + }) +} + +function copyCookie(frontend, targetUrl, urls, name) { + return new Promise(resolve => { + browser.storage.local.get("options", r => { + let query + if (!r.options.firstPartyIsolate) + query = { + url: protocolHost(targetUrl), + name: name, + } + else + query = { + url: protocolHost(targetUrl), + name: name, + firstPartyDomain: null, + } + browser.cookies.getAll(query, async cookies => { + for (const cookie of cookies) + if (cookie.name == name) { + for (const url of urls) { + const setQuery = r.options.firstPartyIsolate + ? { + url: url, + name: name, + value: cookie.value, + secure: true, + firstPartyDomain: new URL(url).hostname, + } + : { + url: url, + name: name, + value: cookie.value, + secure: true, + expirationDate: cookie.expirationDate, + } + browser.cookies.set(setQuery) + } + break + } + resolve() + }) + }) + }) +} + +function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) { + return new Promise(resolve => { + const http = new XMLHttpRequest() + const url = `${targetUrl}${endpoint}` + http.open("GET", url, false) + //http.setRequestHeader("Cookie", `${name}=${cookie.value}`) + http.send(null) + const preferences = JSON.parse(http.responseText) + let formdata = new FormData() + for (var key in preferences) formdata.append(key, preferences[key]) + for (const url of urls) { + const http = new XMLHttpRequest() + http.open("POST", `${url}/settings/stay`, false) + http.send(null) + } + resolve() + return + }) +} + +function copyRaw(test, copyRawElement) { + return new Promise(resolve => { + browser.tabs.query({ active: true, currentWindow: true }, async tabs => { + let currTab = tabs[0] + if (currTab) { + let url + try { + url = new URL(currTab.url) + } catch { + resolve() + return + } + + const newUrl = await servicesHelper.reverse(url) + + if (newUrl) { + resolve(newUrl) + if (test) return + navigator.clipboard.writeText(newUrl) + if (copyRawElement) { + const textElement = copyRawElement.getElementsByTagName("h4")[0] + const oldHtml = textElement.innerHTML + textElement.innerHTML = browser.i18n.getMessage("copied") + setTimeout(() => (textElement.innerHTML = oldHtml), 1000) + } + } + } + resolve() + }) + }) +} + +function unify() { + return new Promise(resolve => { + browser.tabs.query({ active: true, currentWindow: true }, async tabs => { + let currTab = tabs[0] + if (currTab) { + let url + try { + url = new URL(currTab.url) + } catch { + resolve() + return + } + + resolve(await servicesHelper.unifyPreferences(url, currTab.id)) + } + }) + }) +} + +function switchInstance(test) { + return new Promise(resolve => { + browser.tabs.query({ active: true, currentWindow: true }, async tabs => { + let currTab = tabs[0] + if (currTab) { + let url + try { + url = new URL(currTab.url) + } catch { + resolve() + return + } + const newUrl = await servicesHelper.switchInstance(url) + + if (newUrl) { + if (!test) browser.tabs.update({ url: newUrl }) + resolve(true) + } else resolve() + } + }) + }) +} + +function latency(service, frontend, document, location) { + let latencyElement = document.getElementById(`latency-${frontend}`) + let latencyLabel = document.getElementById(`latency-${frontend}-label`) + latencyElement.addEventListener("click", async () => { + let reloadWindow = () => location.reload() + latencyElement.addEventListener("click", reloadWindow) + browser.storage.local.get(["redirects", "latency"], r => { + let redirects = r.redirects + let latency = r.latency + const oldHtml = latencyLabel.innerHTML + latencyLabel.innerHTML = "..." + testLatency(latencyLabel, redirects[frontend].clearnet, frontend).then(r => { + latency[frontend] = r + browser.storage.local.set({ latency }) + latencyLabel.innerHTML = oldHtml + processDefaultCustomInstances(service, frontend, "clearnet", document) + latencyElement.removeEventListener("click", reloadWindow) + }) + }) + }) +} + +export default { + getRandomInstance, + updateInstances, + protocolHost, + processDefaultCustomInstances, + latency, + copyCookie, + getPreferencesFromToken, + switchInstance, + copyRaw, + unify, + camelCase, +} -- cgit 1.4.1 From cd01a7083ced7f53c4d87e604f4edadce64ca49e Mon Sep 17 00:00:00 2001 From: Hygna Date: Tue, 4 Oct 2022 21:45:39 +0100 Subject: Added LibreTranslate --- src/assets/javascripts/services.js | 5 ++ src/config/config.json | 4 ++ src/instances/blacklist.json | 3 ++ src/instances/data.json | 34 +++++++++---- src/instances/get_instances.py | 7 ++- src/pages/background/background.js | 11 ----- src/pages/options/index.html | 97 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 141 insertions(+), 20 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index eed1e6c6..572a6a9c 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -163,6 +163,11 @@ function redirect(url, type, initiator) { return `freetube://https://youtu.be${url.pathname}${url.search}`.replace(/watch\?v=/, "") case "simplyTranslate": return `${randomInstance}/${url.search}` + case "libreTranslate": + return `${randomInstance}/${url.search}` + .replace(/(?<=\/?)sl/, "source") + .replace(/(?<=&)tl/, "target") + .replace(/(?<=&)text/, "q") case "osm": { if (initiator && initiator.host === "earth.google.com") return const travelModes = { diff --git a/src/config/config.json b/src/config/config.json index 09c95bbb..fde17a02 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -496,6 +496,10 @@ }, "name": "Lingva Translate", "instanceList": true + }, + "libreTranslate": { + "name": "LibreTranslate", + "instanceList": true } }, "targets": ["^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/", "^https?:\\/{2}translate\\.libredirect\\.invalid"], diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index edce1958..90febd0a 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -53,6 +53,7 @@ "https://scribe.rawbit.ninja", "https://lingva.garudalinux.org", "https://translate.dr460nf1r3.org", + "https://libretranslate.com", "https://searx.run", "https://searx.org", "https://search.garudalinux.org", @@ -77,11 +78,13 @@ "https://libreddit.notyourcomputer.net", "https://teddit.ggc-project.de", "https://teddit.tokhmi.xyz", + "https://wiki.privacytools.io", "https://quetre.odyssey346.dev", "https://st.odyssey346.dev", "https://jsearch.pw", "https://searx.gnu.style", "https://searx.semipvt.com", + "https://searx.tyil.nl", "https://etsi.me", "https://search.zzls.xyz", "https://searx.ericaftereric.top", diff --git a/src/instances/data.json b/src/instances/data.json index 839b155b..fac7962d 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -6,9 +6,11 @@ "https://invidious.snopyta.org", "https://invidious.kavin.rocks", "https://inv.riverside.rocks", + "https://invidio.xamh.de", "https://y.com.sb", "https://yt.artemislena.eu", "https://invidious.tiekoetter.com", + "https://invidious.sethforprivacy.com", "https://invidious.flokinet.to", "https://inv.bp.projectsegfau.lt", "https://inv.vern.cc", @@ -19,13 +21,11 @@ "https://invidious.slipfox.xyz", "https://invidious.esmailelbob.xyz", "https://youtube.076.ne.jp", - "https://invidious.sethforprivacy.com", - "https://invidious.namazso.eu", - "https://invidio.xamh.de" + "https://invidious.namazso.eu" ], "tor": [ + "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", - "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", @@ -34,7 +34,7 @@ "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://am74vkcrjp2d5v36lcdqgsj2m6x36tbrkhsruoegwfcizzabnfgf5zyd.onion", "http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion", - "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion" + "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion" ], "i2p": [], "loki": [] @@ -535,6 +535,24 @@ "i2p": [], "loki": [] }, + "libreTranslate": { + "clearnet": [ + "https://libretranslate.com", + "https://libretranslate.de", + "https://translate.argosopentech.com", + "https://translate.api.skitzen.com", + "https://translate.fortytwo-it.com", + "https://translate.terraprint.co", + "https://lt.vern.cc" + ], + "tor": [ + "http://lt.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" + ], + "i2p": [ + "http://vernf45n7mxwqnp5riaax7p67pwcl7wcefdcnqqvim7ckdx4264a.b32.i2p" + ], + "loki": [] + }, "searx": { "clearnet": [ "https://dynabyte.ca", @@ -572,12 +590,10 @@ "https://suche.uferwerk.org", "https://sx.catgirl.cloud", "https://timdor.noip.me/searx", - "https://xo.wtf", "https://searx.roflcopter.fr" ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", - "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", @@ -667,9 +683,11 @@ "https://trydex.tk/searxng", "https://www.gruble.de", "https://www.webrats.xyz", - "https://xcxc.ml" + "https://xcxc.ml", + "https://xo.wtf" ], "tor": [ + "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", "http://privateoz3u5utrimal2edr56j3r5caakektxxgixigdkycuxigvquid.onion", "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 96902feb..9fc64adc 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -309,7 +309,7 @@ def bibliogram(): def libreddit(): - fetchRegexList('libreddit', 'Libreddit', 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md', r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|") + fetchJsonList('libreddit', 'Libreddit', 'https://github.com/libbacon/libreddit-instances/raw/master/instances.json', {'clearnet': 'url', 'tor': 'onion', 'i2p': 'i2p', 'loki': None}, True) def teddit(): @@ -433,6 +433,10 @@ def facil(): fetchFromFile('facil', 'FacilMap') +def libreTranslate(): + fetchRegexList('libreTranslate', 'LibreTranslate', 'https://raw.githubusercontent.com/LibreTranslate/LibreTranslate/main/README.md', r"\[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\)\|") + + def peertube(): r = requests.get( 'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt') @@ -470,6 +474,7 @@ quetre() libremdb() simplytranslate() linvgatranslate() +libreTranslate() searx_searxng() whoogle() librex() diff --git a/src/pages/background/background.js b/src/pages/background/background.js index cad08580..e8d0fd76 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -20,17 +20,6 @@ function initDefaults() { } browser.runtime.onInstalled.addListener(details => { - // if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { - // if (details.reason == "update") - // browser.storage.local.get(null, r => { - // if (r.theme) { - // const old = encodeURIComponent(JSON.stringify(r)) - // browser.tabs.create({ url: browser.runtime.getURL(`/pages/background/reset_warning.html?data=${old}`) }); - // } - // initDefaults(); - // }) - // else initDefaults(); - // } switch (details.reason) { case "install": initDefaults() diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 53ee562e..323984ed 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -2863,6 +2863,7 @@ @@ -3058,6 +3059,102 @@
+ +
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
-- cgit 1.4.1 From a96f3188b7eac79f19f2bd438b13a310d3cea90b Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 5 Oct 2022 17:29:27 +0100 Subject: Changes: Added BreezeWiki as a frontend for Fandom Closes https://github.com/libredirect/libredirect/issues/444 Futureproofed bug caused by adding new frontend/service --- src/assets/images/fandom-icon.svg | 1 + src/assets/javascripts/services.js | 56 +++++++++++++++++ src/config/config.json | 14 +++++ src/instances/blacklist.json | 23 ++----- src/instances/data.json | 115 ++++++++--------------------------- src/instances/get_instances.py | 5 ++ src/pages/background/background.js | 3 + src/pages/options/index.html | 120 +++++++++++++++++++++++++++++++++++++ src/pages/popup/popup.html | 10 ++++ 9 files changed, 238 insertions(+), 109 deletions(-) create mode 100644 src/assets/images/fandom-icon.svg diff --git a/src/assets/images/fandom-icon.svg b/src/assets/images/fandom-icon.svg new file mode 100644 index 00000000..0cd873bf --- /dev/null +++ b/src/assets/images/fandom-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 572a6a9c..d7cb520b 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -386,6 +386,11 @@ function redirect(url, type, initiator) { return `${randomInstance}/${params.sl}/${params.tl}/${params.text}` } return randomInstance + case "breezeWiki": + let wiki = url.hostname.match(/^[a-zA-Z0-9]+(?=\.fandom\.com)/) + if (wiki == "www" || !wiki) wiki = "" + else wiki = "/" + wiki + return `${randomInstance}${wiki}${url.pathname}${url.search}`.replace(/Special:Search\?query/, "search?q") default: return `${randomInstance}${url.pathname}${url.search}` } @@ -685,6 +690,56 @@ function upgradeOptions() { }) } +function processUpdate() { + return new Promise(resolve => { + fetch("/instances/data.json") + .then(response => response.text()) + .then(data => { + fetch("/config/config.json") + .then(response => response.text()) + .then(configData => { + browser.storage.local.get(["options", "blacklists", "targets"], r => { + let redirects = JSON.parse(data) + let options = r.options + let targets = r.targets + let config = JSON.parse(configData) + for (const service in config.services) { + if (!options[service]) { + options[service] = {} + if (config.services[service].targets == "datajson") { + targets[service] = redirects[service] + } + for (const defaultOption in config.services[service].options) { + options[service][defaultOption] = config.services[service].options[defaultOption] + } + } + for (const frontend in config.services[service].frontends) { + if (!options[service][frontend]) { + if (config.services[service].frontends[frontend].instanceList) { + options[frontend] = {} + for (const network in config.networks) { + options[frontend][network] = {} + options[frontend][network].enabled = JSON.parse(data)[frontend][network] + options[frontend][network].custom = [] + } + for (const blacklist in r.blacklists) { + for (const instance of r.blacklists[blacklist]) { + let i = options[frontend].clearnet.enabled.indexOf(instance) + if (i > -1) options[frontend].clearnet.enabled.splice(i, 1) + } + } + } + } + } + } + browser.storage.local.set({ redirects, options, targets }) + resolve() + }) + }) + }) + }) +} + export default { redirect, computeService, @@ -694,4 +749,5 @@ export default { setRedirects, initDefaults, upgradeOptions, + processUpdate, } diff --git a/src/config/config.json b/src/config/config.json index fde17a02..61195830 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -362,6 +362,20 @@ "embeddable": false, "url": "https://reuters.com" }, + "fandom": { + "frontends": { + "breezeWiki": { + "name": "BreezeWiki", + "instanceList": true + } + }, + "targets": ["^https?:\\/{2}(?:[a-zA-Z0-9]+\\.)?fandom\\.com(?=(?:\\/wiki)|(?:\\/?$))"], + "name": "Fandom", + "options": { "enabled": true }, + "imageType": "svg", + "embeddable": false, + "url": "https://fandom.com" + }, "peertube": { "frontends": { "simpleertube": { diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 90febd0a..d75c36d8 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -28,18 +28,6 @@ "https://n.sneed.network", "https://nitter.twei.space", "https://nitter.d420.de", - "https://libreddit.domain.glass", - "https://r.nf", - "https://libreddit.hu", - "https://lr.stilic.ml", - "https://reddi.tk", - "https://r.walkx.org", - "https://libreddit.yonalee.eu", - "https://libreddit.winscloud.net", - "https://r.ahwx.org", - "https://reddit.dr460nf1r3.org", - "https://libreddit.encrypted-data.xyz", - "https://libreddit.eu.org", "https://teddit.domain.glass", "https://teddit.httpjames.space", "https://teddit.encrypted-data.xyz", @@ -73,18 +61,14 @@ "https://nhanh.cloud", "https://nitter.winscloud.net", "https://ntr.odyssey346.dev", - "https://libreddit.yonalee.eu", - "https://libreddit.winscloud.net", - "https://libreddit.notyourcomputer.net", "https://teddit.ggc-project.de", "https://teddit.tokhmi.xyz", - "https://wiki.privacytools.io", "https://quetre.odyssey346.dev", + "https://simplytranslate.org", "https://st.odyssey346.dev", "https://jsearch.pw", "https://searx.gnu.style", "https://searx.semipvt.com", - "https://searx.tyil.nl", "https://etsi.me", "https://search.zzls.xyz", "https://searx.ericaftereric.top", @@ -93,7 +77,10 @@ "https://whoogle.esmailelbob.xyz", "https://search.wef.lol", "https://i.bcow.xyz", + "https://rimgo.totaldarkness.net", + "https://imgur.artemislena.eu", "https://lbry.bcow.xyz", - "https://beatbump.ml" + "https://beatbump.ml", + "https://bw.odyssey346.dev" ] } \ No newline at end of file diff --git a/src/instances/data.json b/src/instances/data.json index fac7962d..eaefc4ed 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -13,19 +13,20 @@ "https://invidious.sethforprivacy.com", "https://invidious.flokinet.to", "https://inv.bp.projectsegfau.lt", - "https://inv.vern.cc", "https://invidious.nerdvpn.de", "https://invidious.projectsegfau.lt", "https://invidious.rhyshl.live", "https://inv.privacy.com.de", "https://invidious.slipfox.xyz", - "https://invidious.esmailelbob.xyz", "https://youtube.076.ne.jp", + "https://invidious.esmailelbob.xyz", + "https://inv.vern.cc", "https://invidious.namazso.eu" ], "tor": [ - "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", + "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", + "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", @@ -33,8 +34,7 @@ "http://invidious.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://am74vkcrjp2d5v36lcdqgsj2m6x36tbrkhsruoegwfcizzabnfgf5zyd.onion", - "http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion", - "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion" + "http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion" ], "i2p": [], "loki": [] @@ -51,9 +51,7 @@ "https://piped.garudalinux.org", "https://y.rivo.lol", "https://yt.jae.fi", - "https://piped.mint.lgbt", "https://il.ax", - "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt", "https://piped.privacydev.net", "https://piped.smnz.de", @@ -208,7 +206,8 @@ "https://nitter.caioalonso.com", "https://nitter.at", "https://nitter.drivet.xyz", - "https://nitter.pw" + "https://nitter.pw", + "https://nitter.nicfab.eu" ], "tor": [ "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -261,87 +260,8 @@ "loki": [] }, "libreddit": { - "clearnet": [ - "https://libredd.it", - "https://libreddit.spike.codes", - "https://libreddit.dothq.co", - "https://libreddit.kavin.rocks", - "https://reddit.invak.id", - "https://reddit.phii.me", - "https://lr.riverside.rocks", - "https://libreddit.strongthany.cc", - "https://libreddit.database.red", - "https://libreddit.privacy.com.de", - "https://libreddit.domain.glass", - "https://libreddit.sugoma.tk", - "https://libreddit.jamiethalacker.dev", - "https://reddit.artemislena.eu", - "https://r.nf", - "https://libreddit.some-things.org", - "https://reddit.stuehieyr.com", - "https://lr.mint.lgbt", - "https://libreddit.igna.rocks", - "https://libreddit.autarkic.org", - "https://libreddit.flux.industries", - "https://libreddit.drivet.xyz", - "https://lr.oversold.host", - "https://libreddit.de", - "https://libreddit.pussthecat.org", - "https://libreddit.mutahar.rocks", - "https://libreddit.northboot.xyz", - "https://leddit.xyz", - "https://de.leddit.xyz", - "https://lr.cowfee.moe", - "https://libreddit.hu", - "https://libreddit.totaldarkness.net", - "https://libreddit.esmailelbob.xyz", - "https://lr.vern.cc", - "https://libreddit.nl", - "https://lr.stilic.ml", - "https://reddi.tk", - "https://libreddit.bus-hit.me", - "https://libreddit.datatunnel.xyz", - "https://libreddit.crewz.me", - "https://r.walkx.org", - "https://libreddit.kylrth.com", - "https://libreddit.yonalee.eu", - "https://libreddit.winscloud.net", - "https://libreddit.tiekoetter.com", - "https://reddit.rtrace.io", - "https://libreddit.lunar.icu", - "https://libreddit.privacydev.net", - "https://libreddit.notyourcomputer.net", - "https://r.ahwx.org", - "https://bob.fr.to", - "https://reddit.beparanoid.de", - "https://libreddit.dcs0.hu", - "https://reddit.dr460nf1r3.org", - "https://rd.jae.su", - "https://libreddit.mha.fi", - "https://libreddit.foss.wtf", - "https://libreddit.encrypted-data.xyz", - "https://libreddit.eu.org", - "https://l.opnxng.com" - ], - "tor": [ - "http://spjmllawtheisznfs7uryhxumin26ssv2draj7oope3ok3wuhy43eoyd.onion", - "http://fwhhsbrbltmrct5hshrnqlqygqvcgmnek3cnka55zj4y7nuus5muwyyd.onion", - "http://kphht2jcflojtqte4b4kyx7p2ahagv4debjj32nre67dxz7y57seqwyd.onion", - "http://inytumdgnri7xsqtvpntjevaelxtgbjqkuqhtf6txxhwbll2fwqtakqd.onion", - "http://liredejj74h5xjqr2dylnl5howb2bpikfowqoveub55ru27x43357iid.onion", - "http://kzhfp3nvb4qp575vy23ccbrgfocezjtl5dx66uthgrhu7nscu6rcwjyd.onion", - "http://ecue64ybzvn6vjzl37kcsnwt4ycmbsyf74nbttyg7rkc3t3qwnj7mcyd.onion", - "http://ledditqo2mxfvlgobxnlhrkq4dh34jss6evfkdkb2thlvy6dn4f4gpyd.onion", - "http://libredoxhxwnmsb6dvzzd35hmgzmawsq5i764es7witwhddvpc2razid.onion", - "http://libreddit.2syis2nnyytz6jnusnjurva4swlaizlnleiks5mjp46phuwjbdjqwgqd.onion", - "http://ol5begilptoou34emq2sshf3may3hlblvipdjtybbovpb7c7zodxmtqd.onion", - "http://lbrdtjaj7567ptdd4rv74lv27qhxfkraabnyphgcvptl64ijx2tijwid.onion", - "http://libreddit.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion", - "http://reddit.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion", - "http://inz6tbezfwzexva6dize4cqraj2tjdhygxabmcgysccesvw2pybzhbyd.onion", - "http://libreddit.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", - "http://lr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion" - ], + "clearnet": [], + "tor": [], "i2p": [], "loki": [] }, @@ -596,8 +516,10 @@ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", + "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", + "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], "i2p": [ @@ -694,8 +616,6 @@ "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://b2c7fvbhnfvwnl6oh2tydhzfx4i37kmmrycq42heqbbe7wovq3uzenid.onion", - "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", - "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion", "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", @@ -829,8 +749,21 @@ "i2p": [], "loki": [] }, + "breezeWiki": { + "clearnet": [ + "https://breezewiki.com", + "https://breezewiki.pussthecat.org", + "https://bw.odyssey346.dev", + "https://bw.vern.cc", + "https://breezewiki.esmailelbob.xyz" + ], + "tor": [], + "i2p": [], + "loki": [] + }, "peertube": [ "https://search.joinpeertube.org", + "https://freedomadultgames.video", "https://tbh.co-shaoghal.net", "https://tube.kansanvalta.org", "https://duanrra.cf", diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 9fc64adc..fc730cf6 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -437,6 +437,10 @@ def libreTranslate(): fetchRegexList('libreTranslate', 'LibreTranslate', 'https://raw.githubusercontent.com/LibreTranslate/LibreTranslate/main/README.md', r"\[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\)\|") +def breezeWiki(): + fetchRegexList('breezeWiki', 'BreezeWiki', 'https://gitdab.com/cadence/breezewiki-docs/raw/branch/main/docs.scrbl', r"\(\"[^\n\s\r\t\f\v\"]+\" \"https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+(?:\/[^\s\/]+)*\" \"(https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+(?:\/[^\s\/]+)*)\"\)") + + def peertube(): r = requests.get( 'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt') @@ -485,6 +489,7 @@ beatbump() hyperpipe() facil() simpleertube() +breezeWiki() mightyList = filterLastSlash(mightyList) mightyList = idnaEncode(mightyList) diff --git a/src/pages/background/background.js b/src/pages/background/background.js index e8d0fd76..3f0e0fdd 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -30,11 +30,14 @@ browser.runtime.onInstalled.addListener(details => { .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() } }) }) diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 323984ed..faeb5124 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -84,6 +84,11 @@ Reuters +
+
+ + +
+ +
+
@@ -2200,6 +2212,114 @@
+ +
+
+

Fandom

+
+
+
+

Enable

+ +
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ +
+
+

PeerTube

@@ -186,6 +191,11 @@

Reuters

+

PeerTube

-- cgit 1.4.1 From 12b6f9cdbb8bb20452b900c51edd69bea6c489a5 Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 5 Oct 2022 18:00:27 +0100 Subject: Added search redirections from Fandom to BreezeWiki --- src/assets/javascripts/services.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index d7cb520b..944a6d30 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -390,7 +390,8 @@ function redirect(url, type, initiator) { let wiki = url.hostname.match(/^[a-zA-Z0-9]+(?=\.fandom\.com)/) if (wiki == "www" || !wiki) wiki = "" else wiki = "/" + wiki - return `${randomInstance}${wiki}${url.pathname}${url.search}`.replace(/Special:Search\?query/, "search?q") + if (url.href.search(/Special:Search\?query/) > -1) return `${randomInstance}${wiki}${url.pathname}${url.search}`.replace(/Special:Search\?query/, "search?q").replace(/\/wiki/, "") + else return `${randomInstance}${wiki}${url.pathname}${url.search}` default: return `${randomInstance}${url.pathname}${url.search}` } -- cgit 1.4.1 From beaaeb1d309555531a22e350b73ff014cccd1e16 Mon Sep 17 00:00:00 2001 From: Hygna Date: Wed, 5 Oct 2022 19:27:27 +0100 Subject: Added support for i.stack.imgur.com and rimgo embeds Closes https://codeberg.org/LibRedirect/libredirect/issues/18 --- src/assets/javascripts/services.js | 16 ++++++++++++++-- src/config/config.json | 10 +++++++--- src/pages/options/index.html | 10 +++++++++- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 944a6d30..98f17763 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -61,6 +61,7 @@ function regexArray(service, url, config) { } function redirect(url, type, initiator) { + if (type != "main_frame" && type != "sub_frame") return let randomInstance let frontend for (const service in config.services) { @@ -392,6 +393,9 @@ function redirect(url, type, initiator) { else wiki = "/" + wiki if (url.href.search(/Special:Search\?query/) > -1) return `${randomInstance}${wiki}${url.pathname}${url.search}`.replace(/Special:Search\?query/, "search?q").replace(/\/wiki/, "") else return `${randomInstance}${wiki}${url.pathname}${url.search}` + case "rimgo": + if (url.href.search(/^https?:\/{2}(?:[im]\.)?stack\./) > -1) return `${randomInstance}/stack${url.pathname}${url.search}` + else return `${randomInstance}${url.pathname}${url.search}` default: return `${randomInstance}${url.pathname}${url.search}` } @@ -440,8 +444,16 @@ function switchInstance(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 instancesList + if (Object.keys(config.services[service].frontends).length == 1) { + const frontend = Object.keys(config.services[service].frontends)[0] + instancesList = [...options[frontend][options.network].enabled, ...options[frontend][options.network].custom] + if (instancesList.length === 0 && options.networkFallback) instancesList = [...options[frontend].clearnet.enabled, ...options[frontend].clearnet.custom] + } else { + const frontend = options[service].frontend + instancesList = [...options[frontend][options.network].enabled, ...options[frontend][options.network].custom] + if (instancesList.length === 0 && options.networkFallback) instancesList = [...options[frontend].clearnet.enabled, ...options[frontend].clearnet.custom] + } let oldInstance const i = instancesList.indexOf(protocolHost) diff --git a/src/config/config.json b/src/config/config.json index 61195830..97168263 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -254,14 +254,18 @@ "frontends": { "rimgo": { "name": "rimgo", + "embeddable": true, "instanceList": true } }, - "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], + "targets": ["^https?:\\/{2}([im]\\.)?(stack\\.)?imgur\\.(com|io)(\\/|$)"], "name": "Imgur", - "options": { "enabled": true }, + "options": { + "enabled": true, + "redirectType": "both" + }, "imageType": "png", - "embeddable": false, + "embeddable": true, "url": "https://imgur.com" }, "wikipedia": { diff --git a/src/pages/options/index.html b/src/pages/options/index.html index faeb5124..597d7cb9 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -1574,7 +1574,15 @@

Enable

-
+
+

Redirect Type

+ +
+
-- cgit 1.4.1 From c0b93130f00fbef01e89d3318a68bc56e1e347ed Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 6 Oct 2022 08:29:34 +0100 Subject: Fixed Libreddit and LibreX instance fetching --- src/instances/get_instances.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index fc730cf6..f0fa8496 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -141,6 +141,8 @@ def fetchJsonList(frontend, name, url, urlItem, jsonObject): try: r = requests.get(url) rJson = json.loads(r.text) + if jsonObject: + rJson = rJson['instances'] _list = {} for network in config['networks']: _list[network] = [] @@ -148,12 +150,10 @@ def fetchJsonList(frontend, name, url, urlItem, jsonObject): for item in rJson: for network in config['networks']: if urlItem[network] is not None: - if urlItem[network] in item: + if urlItem[network] in item and item[urlItem[network]] is not None: if item[urlItem[network]].strip() != '': _list[network].append(item[urlItem[network]]) else: - if jsonObject: - rJson = rJson['instances'] for item in rJson: tmpItem = item if urlItem is not None: -- cgit 1.4.1 From 3bd83642f367d1b27d1acfa7ebd4ef6ba7116fcb Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 6 Oct 2022 11:12:35 +0100 Subject: Made peertube instance list use cache if it fails --- src/instances/get_instances.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index f0fa8496..2f3c75dc 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -442,16 +442,19 @@ def breezeWiki(): def peertube(): - r = requests.get( - 'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt') - rJson = json.loads(r.text) + try: + r = requests.get( + 'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt') + rJson = json.loads(r.text) - myList = ['https://search.joinpeertube.org'] - for k in rJson['data']: - myList.append('https://'+k['host']) + myList = ['https://search.joinpeertube.org'] + for k in rJson['data']: + myList.append('https://'+k['host']) - mightyList['peertube'] = myList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'PeerTube') + mightyList['peertube'] = myList + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'PeerTube') + except Exception: + fetchCache('peertube', 'PeerTube') def isValid(url): # This code is contributed by avanitrachhadiya2155 -- cgit 1.4.1 From 04fd2de0bb051a9cde33095f0d338f4700c335ce Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 6 Oct 2022 14:19:05 +0100 Subject: Fixed twimg redirects Closes https://github.com/libredirect/libredirect/issues/307 --- src/assets/javascripts/services.js | 53 +++++++++++++++----------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 98f17763..af3e2380 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -150,9 +150,13 @@ function redirect(url, type, initiator) { if (search !== "") search = `?${search}` if (url.host.split(".")[0] === "pbs" || url.host.split(".")[0] === "video") { - const [, id, format, extra] = url.search.match(/(.*)\?format=(.*)&(.*)/) - const query = encodeURIComponent(`${id}.${format}?${extra}`) - return `${randomInstance}/pic${search}${query}` + try { + const [, id, format, extra] = search.match(/(.*)\?format=(.*)&(.*)/) + const query = encodeURIComponent(`${id}.${format}?${extra}`) + return `${randomInstance}/pic${url.pathname}${query}` + } catch { + return `${randomInstance}/pic${url.pathname}${search}` + } } if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${search}` @@ -412,20 +416,13 @@ function computeService(url, returnFrontend) { const options = r.options for (const service in config.services) { if (regexArray(service, url, config)) { - if (returnFrontend) { - resolve([service, null]) - } else { - resolve(service) - } + resolve(service) return } else { for (const frontend in config.services[service].frontends) { if (all(service, frontend, options, config, redirects).includes(utils.protocolHost(url))) { - if (returnFrontend) { - resolve([service, frontend]) - } else { - resolve(service) - } + if (returnFrontend) resolve([service, frontend, url.hostname]) + else resolve(service) return } } @@ -601,12 +598,8 @@ function initDefaults() { const latency = {} for (const service in config.services) { options[service] = {} - if (config.services[service].targets == "datajson") { - targets[service] = redirects[service] - } - for (const defaultOption in config.services[service].options) { - options[service][defaultOption] = config.services[service].options[defaultOption] - } + if (config.services[service].targets == "datajson") targets[service] = redirects[service] + for (const defaultOption in config.services[service].options) options[service][defaultOption] = config.services[service].options[defaultOption] for (const frontend in config.services[service].frontends) { if (config.services[service].frontends[frontend].instanceList) { options[frontend] = {} @@ -717,24 +710,20 @@ function processUpdate() { let targets = r.targets let config = JSON.parse(configData) for (const service in config.services) { - if (!options[service]) { - options[service] = {} - if (config.services[service].targets == "datajson") { - targets[service] = redirects[service] - } - for (const defaultOption in config.services[service].options) { - options[service][defaultOption] = config.services[service].options[defaultOption] - } - } + if (!options[service]) options[service] = {} + if (config.services[service].targets == "datajson") targets[service] = redirects[service] + for (const defaultOption in config.services[service].options) if (!options[service][defaultOption]) options[service][defaultOption] = config.services[service].options[defaultOption] for (const frontend in config.services[service].frontends) { - if (!options[service][frontend]) { - if (config.services[service].frontends[frontend].instanceList) { - options[frontend] = {} - for (const network in config.networks) { + if (config.services[service].frontends[frontend].instanceList) { + for (const network in config.networks) { + if (!options[frontend][network]) { options[frontend][network] = {} options[frontend][network].enabled = JSON.parse(data)[frontend][network] options[frontend][network].custom = [] } + } + if (!options[service][frontend]) { + options[frontend] = {} for (const blacklist in r.blacklists) { for (const instance of r.blacklists[blacklist]) { let i = options[frontend].clearnet.enabled.indexOf(instance) -- cgit 1.4.1 From 9b996dcdf2af3cd9a91919cbbca9ea1dbe538f62 Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 6 Oct 2022 21:12:51 +0100 Subject: Fixed some more bugs --- src/assets/javascripts/services.js | 18 +++++++++--------- src/pages/popup/popup.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index af3e2380..a102a297 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -73,7 +73,7 @@ function redirect(url, type, initiator) { if (!regexArray(service, url, config)) continue if (initiator) { if (targets.test(initiator.host)) continue - if (all(service, null, options, config, redirects).includes(initiator.origin)) return "BYPASSTAB" + if (all(service, null, options, config, redirects).includes(initiator.origin) && reverse(initiator) == url) return "BYPASSTAB" } if (Object.keys(config.services[service].frontends).length > 1) { @@ -715,19 +715,19 @@ function processUpdate() { for (const defaultOption in config.services[service].options) if (!options[service][defaultOption]) options[service][defaultOption] = config.services[service].options[defaultOption] for (const frontend in config.services[service].frontends) { if (config.services[service].frontends[frontend].instanceList) { + if (!options[frontend]) options[frontend] = {} for (const network in config.networks) { if (!options[frontend][network]) { options[frontend][network] = {} options[frontend][network].enabled = JSON.parse(data)[frontend][network] options[frontend][network].custom = [] - } - } - if (!options[service][frontend]) { - options[frontend] = {} - for (const blacklist in r.blacklists) { - for (const instance of r.blacklists[blacklist]) { - let i = options[frontend].clearnet.enabled.indexOf(instance) - if (i > -1) options[frontend].clearnet.enabled.splice(i, 1) + if (network == "clearnet") { + for (const blacklist in r.blacklists) { + for (const instance of r.blacklists[blacklist]) { + let i = options[frontend].clearnet.enabled.indexOf(instance) + if (i > -1) options[frontend].clearnet.enabled.splice(i, 1) + } + } } } } diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index ed1546c7..a4b73093 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -81,7 +81,7 @@ browser.storage.local.get("options", r => { let service = await serviceHelper.computeService(url, true) let frontend if (service) { - if (service[0]) { + if (typeof service != "string") { frontend = service[1] service = service[0] } -- cgit 1.4.1 From 9d2b5c5877f4315457af45d9275f0dd8a452e062 Mon Sep 17 00:00:00 2001 From: Woodpecker CI Date: Fri, 7 Oct 2022 00:09:41 +0000 Subject: updated instances --- src/instances/blacklist.json | 19 ++++++-- src/instances/data.json | 104 +++++++++++++++++++++++++++++++++---------- 2 files changed, 95 insertions(+), 28 deletions(-) diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index d75c36d8..992466d1 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -3,13 +3,11 @@ "https://invidious.kavin.rocks", "https://invidious.rhyshl.live", "https://piped.kavin.rocks", - "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://watch.whatever.social", - "https://piped.garudalinux.org", "https://y.rivo.lol", "https://nitter.domain.glass", "https://birdsite.xanny.family", @@ -28,6 +26,17 @@ "https://n.sneed.network", "https://nitter.twei.space", "https://nitter.d420.de", + "https://libreddit.domain.glass", + "https://r.nf", + "https://libreddit.hu", + "https://reddi.tk", + "https://r.walkx.org", + "https://r.ahwx.org", + "https://reddit.dr460nf1r3.org", + "https://libreddit.encrypted-data.xyz", + "https://libreddit.eu.org", + "https://libreddit.cachyos.org", + "https://futureddit.gq", "https://teddit.domain.glass", "https://teddit.httpjames.space", "https://teddit.encrypted-data.xyz", @@ -57,6 +66,7 @@ ], "offline": [ "https://invidious.rhyshl.live", + "https://invidious.esmailelbob.xyz", "https://proxitok.odyssey346.dev", "https://nhanh.cloud", "https://nitter.winscloud.net", @@ -65,6 +75,7 @@ "https://teddit.tokhmi.xyz", "https://quetre.odyssey346.dev", "https://simplytranslate.org", + "https://translate.northboot.xyz", "https://st.odyssey346.dev", "https://jsearch.pw", "https://searx.gnu.style", @@ -74,11 +85,11 @@ "https://searx.ericaftereric.top", "https://searx.fmac.xyz", "https://www.webrats.xyz", + "https://gowogle.voring.me", "https://whoogle.esmailelbob.xyz", "https://search.wef.lol", "https://i.bcow.xyz", - "https://rimgo.totaldarkness.net", - "https://imgur.artemislena.eu", + "https://i.actionsack.com", "https://lbry.bcow.xyz", "https://beatbump.ml", "https://bw.odyssey346.dev" diff --git a/src/instances/data.json b/src/instances/data.json index eaefc4ed..cbff9aac 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -9,24 +9,23 @@ "https://invidio.xamh.de", "https://y.com.sb", "https://yt.artemislena.eu", - "https://invidious.tiekoetter.com", "https://invidious.sethforprivacy.com", + "https://invidious.tiekoetter.com", "https://invidious.flokinet.to", "https://inv.bp.projectsegfau.lt", + "https://inv.vern.cc", "https://invidious.nerdvpn.de", "https://invidious.projectsegfau.lt", "https://invidious.rhyshl.live", "https://inv.privacy.com.de", - "https://invidious.slipfox.xyz", - "https://youtube.076.ne.jp", "https://invidious.esmailelbob.xyz", - "https://inv.vern.cc", + "https://youtube.076.ne.jp", + "https://invidious.slipfox.xyz", "https://invidious.namazso.eu" ], "tor": [ - "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", - "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", + "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion", "http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion", "http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion", @@ -34,7 +33,8 @@ "http://invidious.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", "http://am74vkcrjp2d5v36lcdqgsj2m6x36tbrkhsruoegwfcizzabnfgf5zyd.onion", - "http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion" + "http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion", + "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion" ], "i2p": [], "loki": [] @@ -42,18 +42,18 @@ "piped": { "clearnet": [ "https://piped.kavin.rocks", - "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://watch.whatever.social", - "https://piped.garudalinux.org", "https://y.rivo.lol", "https://yt.jae.fi", + "https://piped.mint.lgbt", "https://il.ax", "https://piped.projectsegfau.lt", "https://piped.privacydev.net", + "https://piped.palveluntarjoaja.eu", "https://piped.smnz.de", "https://piped.adminforge.de", "https://watch.whatevertinfoil.de", @@ -260,8 +260,55 @@ "loki": [] }, "libreddit": { - "clearnet": [], - "tor": [], + "clearnet": [ + "https://libreddit.spike.codes", + "https://libreddit.kavin.rocks", + "https://reddit.invak.id", + "https://lr.riverside.rocks", + "https://libreddit.strongthany.cc", + "https://libreddit.privacy.com.de", + "https://libreddit.domain.glass", + "https://r.nf", + "https://reddit.stuehieyr.com", + "https://lr.mint.lgbt", + "https://libreddit.drivet.xyz", + "https://libreddit.de", + "https://libreddit.pussthecat.org", + "https://libreddit.northboot.xyz", + "https://leddit.xyz", + "https://libreddit.hu", + "https://libreddit.totaldarkness.net", + "https://libreddit.esmailelbob.xyz", + "https://lr.vern.cc", + "https://libreddit.nl", + "https://reddi.tk", + "https://r.walkx.org", + "https://libreddit.kylrth.com", + "https://libreddit.tiekoetter.com", + "https://reddit.rtrace.io", + "https://libreddit.privacydev.net", + "https://r.ahwx.org", + "https://bob.fr.to", + "https://libreddit.dcs0.hu", + "https://reddit.dr460nf1r3.org", + "https://rd.jae.su", + "https://libreddit.foss.wtf", + "https://libreddit.encrypted-data.xyz", + "https://libreddit.eu.org", + "https://l.opnxng.com", + "https://libreddit.cachyos.org", + "https://rd.funami.tech", + "https://libreddit.projectsegfau.lt", + "https://futureddit.gq", + "https://lr.slipfox.xyz", + "https://libreddit.oxymagnesium.com", + "https://reddit.utsav2.dev" + ], + "tor": [ + "http://ecue64ybzvn6vjzl37kcsnwt4ycmbsyf74nbttyg7rkc3t3qwnj7mcyd.onion", + "http://libreddit.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", + "http://ojwp2gtj7dq7scd7gnbac6wp53tklgsicteabrnx2pr7zai64wriiaad.onion" + ], "i2p": [], "loki": [] }, @@ -271,7 +318,6 @@ "https://teddit.ggc-project.de", "https://teddit.zaggy.nl", "https://teddit.namazso.eu", - "https://teddit.nautolan.racing", "https://teddit.tinfoil-hat.net", "https://teddit.domain.glass", "https://snoo.ioens.is", @@ -311,7 +357,7 @@ "i2p": [ "http://xugoqcf2pftm76vbznx4xuhrzyb5b6zwpizpnw2hysexjdn5l2tq.b32.i2p", "http://teddit.i2p", - "https://codeberg.org/teddit/teddit/src/branch/main/vzeiwzi7ogwl3ijrfek4fbtwhvamxcpyqoc3s4vcgnhlp54s5clq.b32.i2p", + "http://vzeiwzi7ogwl3ijrfek4fbtwhvamxcpyqoc3s4vcgnhlp54s5clq.b32.i2p", "http://verncco2oaxjikammz4pi7umzp673cme6zuemx7yeeewspwrw3va.b32.i2p" ], "loki": [] @@ -516,11 +562,10 @@ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", - "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", + "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion" ], "i2p": [ "http://ransack.i2p", @@ -616,8 +661,9 @@ "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", "http://b2c7fvbhnfvwnl6oh2tydhzfx4i37kmmrycq42heqbbe7wovq3uzenid.onion", + "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", + "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion", - "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", @@ -648,9 +694,23 @@ "loki": [] }, "librex": { - "clearnet": [], - "tor": [], - "i2p": [], + "clearnet": [ + "https://librex.beparanoid.de", + "https://librex.extravi.dev", + "https://search.davidovski.xyz", + "https://librex.kitscomputer.tk", + "https://search.funami.tech", + "https://librex.catalyst.sx", + "https://search.madreyk.xyz", + "https://search.pabloferreiro.es" + ], + "tor": [ + "http://librex.2356uhnbpv5nk3bni5bv6jg2cd6lgj664kwx3lhyelstpttpyv4kk2qd.onion", + "http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion" + ], + "i2p": [ + "http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p" + ], "loki": [] }, "rimgo": { @@ -821,7 +881,6 @@ "https://tube.reseau-canope.fr", "https://frentube.myyouniverse.observer", "https://tube-maternelle.apps.education.fr", - "https://peertube.onionstorm.net", "https://dev.dollarvigilante.tv", "https://video.trankil.info", "https://video.uriopss-pdl.fr", @@ -903,7 +962,6 @@ "https://videos.tormentasolar.win", "https://tube.nestor.coop", "https://live.oldskool.fi", - "https://tube.thierrytalbert.fr", "https://peertube.informaction.info", "https://tube.ac-amiens.fr", "https://tube.alado.space", @@ -950,7 +1008,6 @@ "https://videos-passages.huma-num.fr", "https://video.linc.systems", "https://video.sftblw.moe", - "https://peertube.dsmouse.net", "https://ptube.horsentiers.fr", "https://video.cnt.social", "https://tube.03281.fspfc.org", @@ -1339,7 +1396,6 @@ "https://video.lespoesiesdheloise.fr", "https://peertube.luga.at", "https://peertube.roflcopter.fr", - "https://ptube.rousset.nom.fr", "https://peertube.swrs.net", "https://tube.shanti.cafe", "https://videos.cloudron.io", -- cgit 1.4.1 From 6d9ddaae2f6a7c06b01c4df098acb6508021236e Mon Sep 17 00:00:00 2001 From: Hygna Date: Fri, 7 Oct 2022 17:19:35 +0100 Subject: Added support for fetching invidious i2p instances --- src/instances/get_instances.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index 2f3c75dc..b36cf7ab 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -246,6 +246,8 @@ def invidious(): _list['clearnet'].append(instance[1]['uri']) elif instance[1]['type'] == 'onion': _list['tor'].append(instance[1]['uri']) + elif instance[1]['type'] == 'i2p': + _list['i2p'].append(instance[1]['uri']) mightyList[frontend] = _list print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) except Exception: -- 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(-) 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 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(-) 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 From b9d25cd73733d7421c3464dbcb4a87c64ce42b4d Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 9 Oct 2022 09:34:59 +0200 Subject: Changed matrix url from Space to just the room --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c5d6080..483852ba 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A web extension that redirects YouTube, Twitter, Instagram... requests to alternative privacy friendly frontends and backends. -[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect-space:matrix.org) +[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect:matrix.org) [![Firefox users Badge](https://img.shields.io/amo/users/libredirect?label=Firefox%20users)](https://addons.mozilla.org/firefox/addon/libredirect/) [![LibrePay Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect) -- cgit 1.4.1 From 394ef5d3bbe21d28164d8a4ae659c286f737cc58 Mon Sep 17 00:00:00 2001 From: EdwardLangdon Date: Sun, 9 Oct 2022 07:36:44 +0000 Subject: Added OpenCollective to Readme --- .gitignore | 1 + README.md | 3 ++- img/Open-Collective.png | Bin 0 -> 37041 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 img/Open-Collective.png diff --git a/.gitignore b/.gitignore index f6fc62d4..09e0ce26 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ web-ext-artifacts/ nod node_modules package-lock.json +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 8c5d6080..b0a3c9fd 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,8 @@ Send Files => [Send](https://gitlab.com/timvisee/send) [![Liberapay](./img/liberapay.svg)](https://liberapay.com/LibRedirect)  [![Patreon](./img/patreon.svg)](https://patreon.com/LibRedirect)  -[![Buy me a coffee](./img/bmc.svg)](https://www.buymeacoffee.com/libredirect) +[![Buy me a coffee](./img/bmc.svg)](https://www.buymeacoffee.com/libredirect)  + BTC: bc1qrhue0frps6p2vkg978u9ayethnwprtmfug827q\ BCH: qqz5vfnrngk0tjy73q2688qzw4wnllnuzqfndflhl8\ diff --git a/img/Open-Collective.png b/img/Open-Collective.png new file mode 100644 index 00000000..d667babc Binary files /dev/null and b/img/Open-Collective.png differ -- cgit 1.4.1 From ec2a711dee1f25931713705548c5432fd1ab2196 Mon Sep 17 00:00:00 2001 From: EdwardLangdon Date: Sun, 9 Oct 2022 07:45:47 +0000 Subject: Fixed minor markdown error in Previous Commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a42ad18c..16e04a2a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Send Files => [Send](https://gitlab.com/timvisee/send) [![Liberapay](./img/liberapay.svg)](https://liberapay.com/LibRedirect)  [![Patreon](./img/patreon.svg)](https://patreon.com/LibRedirect)  [![Buy me a coffee](./img/bmc.svg)](https://www.buymeacoffee.com/libredirect)  - + BTC: bc1qrhue0frps6p2vkg978u9ayethnwprtmfug827q\ BCH: qqz5vfnrngk0tjy73q2688qzw4wnllnuzqfndflhl8\ -- cgit 1.4.1 From 9a87e7acb6bd7d3072c6ac1b1525c8e639602cd4 Mon Sep 17 00:00:00 2001 From: EdwardLangdon Date: Sun, 9 Oct 2022 07:53:06 +0000 Subject: Changed order of Mirror repos --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 16e04a2a..cc6ba939 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,9 @@ XMR: 4AM5CVfaGsnEXQQjZSzJvaWufe7pT86ubcZPr83fCjb2Hn3iwcForTWFy2Z3ugXcufUwHaGcucf ## Mirror Repos -[![GitHub](https://raw.githubusercontent.com/ManeraKai/manerakai/main/icons/github.svg)](https://github.com/libredirect/libredirect/)   [![Codeberg](https://raw.githubusercontent.com/ManeraKai/manerakai/main/icons/codeberg.svg)](https://codeberg.org/LibRedirect/libredirect)   +[![GitHub](https://raw.githubusercontent.com/ManeraKai/manerakai/main/icons/github.svg)](https://github.com/libredirect/libredirect/)   + ## Translate -- cgit 1.4.1 From 375f4371c3c5e703b07ae3e3d677315134a035ce Mon Sep 17 00:00:00 2001 From: Hygna Date: Sun, 9 Oct 2022 13:11:05 +0100 Subject: Toggle current instance in popup Fixed bug where testing latency of multiple frontends at the same time wouldn't save all of the timings --- src/assets/images/instance-icon.svg | 3 + src/assets/javascripts/services.js | 4 +- src/assets/javascripts/utils.js | 17 ++-- src/config/config.json | 192 ++++++++++++++++++++++++++++-------- src/pages/background/background.js | 1 - src/pages/popup/popup.ejs | 6 ++ src/pages/popup/popup.html | 12 ++- src/pages/popup/popup.js | 31 +++++- src/pages/popup/style.css | 40 ++++++++ 9 files changed, 252 insertions(+), 54 deletions(-) create mode 100644 src/assets/images/instance-icon.svg diff --git a/src/assets/images/instance-icon.svg b/src/assets/images/instance-icon.svg new file mode 100644 index 00000000..6b034c6f --- /dev/null +++ b/src/assets/images/instance-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 80a1ac45..806624d7 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -422,7 +422,7 @@ function computeService(url, returnFrontend) { } else { for (const frontend in config.services[service].frontends) { if (all(service, frontend, options, config, redirects).includes(utils.protocolHost(url))) { - if (returnFrontend) resolve([service, frontend, url.hostname]) + if (returnFrontend) resolve([service, frontend, utils.protocolHost(url)]) else resolve(service) return } @@ -520,7 +520,7 @@ function unifyPreferences(url, tabId) { 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) + await utils.copyCookie(frontendObject, url, instancesList, cookie) } } if ("localstorage" in frontendObject.preferences) { diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 9ae9123f..62041690 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -424,17 +424,20 @@ function latency(service, frontend, document, location) { latencyElement.addEventListener("click", async () => { let reloadWindow = () => location.reload() latencyElement.addEventListener("click", reloadWindow) - browser.storage.local.get(["redirects", "latency"], r => { + browser.storage.local.get("redirects", r => { let redirects = r.redirects - let latency = r.latency const oldHtml = latencyLabel.innerHTML latencyLabel.innerHTML = "..." testLatency(latencyLabel, redirects[frontend].clearnet, frontend).then(r => { - latency[frontend] = r - browser.storage.local.set({ latency }) - latencyLabel.innerHTML = oldHtml - processDefaultCustomInstances(service, frontend, "clearnet", document) - latencyElement.removeEventListener("click", reloadWindow) + const frontendLatency = r + browser.storage.local.get("latency", r => { + let latency = r.latency + latency[frontend] = frontendLatency + browser.storage.local.set({ latency }) + latencyLabel.innerHTML = oldHtml + processDefaultCustomInstances(service, frontend, "clearnet", document) + latencyElement.removeEventListener("click", reloadWindow) + }) }) }) }) diff --git a/src/config/config.json b/src/config/config.json index ff4a869f..8110748f 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -22,8 +22,12 @@ "frontends": { "invidious": { "preferences": { - "cookies": ["PREFS"], - "localstorage": ["dark_mode"] + "cookies": [ + "PREFS" + ], + "localstorage": [ + "dark_mode" + ] }, "name": "Invidious", "embeddable": true, @@ -59,7 +63,9 @@ }, "pipedMaterial": { "preferences": { - "localstorage": ["PREFERENCES"] + "localstorage": [ + "PREFERENCES" + ] }, "name": "Piped-Material", "embeddable": false, @@ -109,7 +115,9 @@ "frontends": { "beatbump": { "preferences": { - "localstorage": ["settings"], + "localstorage": [ + "settings" + ], "indexeddb": "beatbump" }, "name": "Beatbump", @@ -117,14 +125,26 @@ }, "hyperpipe": { "preferences": { - "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], + "localstorage": [ + "api", + "authapi", + "codec", + "locale", + "next", + "pipedapi", + "quality", + "theme", + "vol" + ], "indexeddb": "hyperpipedb" }, "name": "HyperPipe", "instanceList": true } }, - "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], + "targets": [ + "^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)" + ], "name": "YT Music", "options": { "enabled": true, @@ -139,24 +159,23 @@ "nitter": { "preferences": { "cookies": [ - "theme", - "infiniteScroll", - "stickyProfile", + "autoplayGifs", "bidiSupport", - "hideTweetStats", "hideBanner", "hidePins", "hideReplies", - "squareAvatars", - "mp4Playback", + "hideTweetStats", "hlsPlayback", - "proxyVideos", + "infiniteScroll", + "mp4Playback", "muteVideos", - "autoplayGifs", + "proxyVideos", "replaceInstagram", "replaceReddit", "replaceTwitter", - "replaceYouTube" + "replaceYouTube", + "squareAvatars", + "theme" ] }, "name": "Nitter", @@ -164,7 +183,12 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], + "targets": [ + "^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", + "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", + "^https?:\\/{2}platform\\.twitter\\.com/embed", + "^https?:\\/{2}t\\.co" + ], "name": "Twitter", "options": { "enabled": true, @@ -186,7 +210,9 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com\\/p\\/"], + "targets": [ + "^https?:\\/{2}(www\\.)?instagram\\.com\\/p\\/" + ], "name": "Instagram", "options": { "enabled": true @@ -199,13 +225,18 @@ "frontends": { "proxiTok": { "preferences": { - "cookies": ["api-test_endpoints", "theme"] + "cookies": [ + "api-test_endpoints", + "theme" + ] }, "name": "ProxiTok", "instanceList": true } }, - "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], + "targets": [ + "^https?:\\/{2}(www\\.|)tiktok\\.com.*" + ], "name": "TikTok", "options": { "enabled": true @@ -218,7 +249,20 @@ "frontends": { "libreddit": { "preferences": { - "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] + "cookies": [ + "theme", + "front_page", + "layout", + "wide", + "post_sort", + "comment_sort", + "show_nsfw", + "autoplay_videos", + "use_hls", + "hide_hls_notification", + "subscriptions", + "filters" + ] }, "name": "Libreddit", "instanceList": true @@ -248,7 +292,10 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], + "targets": [ + "^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", + "^https?:\\/{2}(i\\.|preview\\.)redd\\.it" + ], "name": "Reddit", "options": { "enabled": true, @@ -266,7 +313,9 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}([im]\\.)?(stack\\.)?imgur\\.(com|io)(\\/|$)"], + "targets": [ + "^https?:\\/{2}([im]\\.)?(stack\\.)?imgur\\.(com|io)(\\/|$)" + ], "name": "Imgur", "options": { "enabled": true, @@ -280,13 +329,18 @@ "frontends": { "wikiless": { "preferences": { - "cookies": ["theme", "default_lang"] + "cookies": [ + "theme", + "default_lang" + ] }, "name": "Wikiless", "instanceList": true } }, - "targets": ["^https?:\\/{2}(?:[a-z]+\\.)*wikipedia\\.org"], + "targets": [ + "^https?:\\/{2}(?:[a-z]+\\.)*wikipedia\\.org" + ], "name": "Wikipedia", "options": { "enabled": false @@ -334,13 +388,17 @@ "frontends": { "quetre": { "preferences": { - "localstorage": ["theme"] + "localstorage": [ + "theme" + ] }, "name": "Quetre", "instanceList": true } }, - "targets": ["^https?:\\/{2}([a-z]+\\.)*quora\\.com.*"], + "targets": [ + "^https?:\\/{2}([a-z]+\\.)*quora\\.com.*" + ], "name": "Quora", "options": { "enabled": true @@ -353,13 +411,17 @@ "frontends": { "libremdb": { "preferences": { - "localstorage": ["theme"] + "localstorage": [ + "theme" + ] }, "name": "libremdb", "instanceList": true } }, - "targets": ["^https?:\\/{2}(?:www\\.|)imdb\\.com\\/title"], + "targets": [ + "^https?:\\/{2}(?:www\\.|)imdb\\.com\\/title" + ], "name": "IMDb", "options": { "enabled": true @@ -375,7 +437,9 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}(www\\.|)reuters\\.com.*"], + "targets": [ + "^https?:\\/{2}(www\\.|)reuters\\.com.*" + ], "name": "Reuters", "options": { "enabled": false @@ -391,7 +455,9 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}(?:[a-zA-Z0-9]+\\.)?fandom\\.com(?=(?:\\/wiki)|(?:\\/?$))"], + "targets": [ + "^https?:\\/{2}(?:[a-zA-Z0-9]+\\.)?fandom\\.com(?=(?:\\/wiki)|(?:\\/?$))" + ], "name": "Fandom", "options": { "enabled": true @@ -420,8 +486,18 @@ "frontends": { "librarian": { "preferences": { - "cookies": ["nsfw", "theme"], - "localstorage": ["autoplay", "autoplayNextVid", "collapseComments", "plyr", "sb_categories", "showRelated"] + "cookies": [ + "nsfw", + "theme" + ], + "localstorage": [ + "autoplay", + "autoplayNextVid", + "collapseComments", + "plyr", + "sb_categories", + "showRelated" + ] }, "name": "Librarian", "embeddable": true, @@ -433,7 +509,10 @@ "instanceList": false } }, - "targets": ["^https?:\\/{2}odysee\\.com", "^https?:\\/{2}lbry\\.tv"], + "targets": [ + "^https?:\\/{2}odysee\\.com", + "^https?:\\/{2}lbry\\.tv" + ], "name": "LBRY", "options": { "enabled": true, @@ -506,13 +585,26 @@ }, "librex": { "preferences": { - "cookies": ["bibliogram", "disable_frontends", " disable_special", "invidious", "libreddit", "nitter", "proxitok", "save", "theme", "wikiless"] + "cookies": [ + "bibliogram", + "disable_frontends", + " disable_special", + "invidious", + "libreddit", + "nitter", + "proxitok", + "save", + "theme", + "wikiless" + ] }, "name": "LibreX", "instanceList": true } }, - "targets": ["^https?:\\/{2}search\\.libredirect\\.invalid"], + "targets": [ + "^https?:\\/{2}search\\.libredirect\\.invalid" + ], "name": "Search", "options": { "enabled": true, @@ -526,14 +618,24 @@ "frontends": { "simplyTranslate": { "preferences": { - "cookies": ["from_lang", "to_lang", "tts_enabled", "use_text_fields"] + "cookies": [ + "from_lang", + "to_lang", + "tts_enabled", + "use_text_fields" + ] }, "name": "SimplyTranslate", "instanceList": true }, "lingva": { "preferences": { - "localstorage": ["isauto", "source", "target", "chakra-ui-color-mode"] + "localstorage": [ + "isauto", + "source", + "target", + "chakra-ui-color-mode" + ] }, "name": "Lingva Translate", "instanceList": true @@ -543,7 +645,10 @@ "instanceList": true } }, - "targets": ["^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/", "^https?:\\/{2}translate\\.libredirect\\.invalid"], + "targets": [ + "^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/", + "^https?:\\/{2}translate\\.libredirect\\.invalid" + ], "name": "Translate", "options": { "enabled": true, @@ -565,7 +670,10 @@ "singleInstance": "https://www.openstreetmap.org" } }, - "targets": ["^https?:\\/{2}maps\\.libredirect\\.invalid", "^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)"], + "targets": [ + "^https?:\\/{2}maps\\.libredirect\\.invalid", + "^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)" + ], "name": "Maps", "options": { "enabled": true, @@ -582,7 +690,11 @@ "instanceList": "true" } }, - "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid", "^https?:\\/{2}send\\.firefox\\.com\\/?$", "^https?:\\/{2}sendfiles\\.online\\/?$"], + "targets": [ + "^https?:\\/{2}send\\.libredirect\\.invalid", + "^https?:\\/{2}send\\.firefox\\.com\\/?$", + "^https?:\\/{2}sendfiles\\.online\\/?$" + ], "name": "Send Files", "options": { "enabled": true diff --git a/src/pages/background/background.js b/src/pages/background/background.js index d252e580..dd8f1715 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -232,7 +232,6 @@ browser.contextMenus.onClicked.addListener((info, tab) => { } } 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 }) diff --git a/src/pages/popup/popup.ejs b/src/pages/popup/popup.ejs index e862e0cb..e6cc6fca 100644 --- a/src/pages/popup/popup.ejs +++ b/src/pages/popup/popup.ejs @@ -8,6 +8,12 @@
+ <%- include('src/pages/widgets/switches', {services: services}) -%>

diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 2dcc12bc..6dc48478 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -8,6 +8,14 @@
+

Youtube

@@ -78,7 +86,7 @@

Fandom

-
+

PeerTube

@@ -196,7 +204,7 @@

Fandom

-
+

PeerTube

diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index a4b73093..78e50004 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -2,7 +2,6 @@ window.browser = window.browser || window.chrome import utils from "../../assets/javascripts/utils.js" -// import generalHelper from "../../assets/javascripts/general.js" import serviceHelper from "../../assets/javascripts/services.js" let config, @@ -40,6 +39,7 @@ const currSite = document.getElementsByClassName("current_site")[0] function setDivs() { return new Promise(resolve => { + divs.instance = document.getElementById("instance") for (const service in config.services) { divs[service] = {} divs[service].toggle = {} @@ -56,8 +56,9 @@ await setDivs() const currentSiteIsFrontend = document.getElementById("current_site_divider") -browser.storage.local.get("options", r => { +browser.storage.local.get(["options", "redirects"], r => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { + document.getElementById("instance-div").classList.add("hide") for (const service in config.services) { if (!r.options.popupServices.includes(service)) allSites.getElementsByClassName(service)[0].classList.add("hide") else allSites.getElementsByClassName(service)[0].classList.remove("hide") @@ -80,10 +81,36 @@ browser.storage.local.get("options", r => { let service = await serviceHelper.computeService(url, true) let frontend + let instance if (service) { if (typeof service != "string") { + instance = service[2] frontend = service[1] service = service[0] + divs.instance.innerHTML = instance.replace(/https?:\/{2}/, "") + let tmp + let instanceNetwork + for (const network in config.networks) { + tmp = r.redirects[frontend][network].indexOf(instance) + if (tmp > -1) { + const instanceDiv = document.getElementById("instance-enabled") + tmp = r.options[frontend][network].enabled.indexOf(instance) + if (tmp > -1) instanceDiv.checked = true + else instanceDiv.checked = false + instanceNetwork = network + instanceDiv.addEventListener("change", () => { + browser.storage.local.get("options", r => { + // Although options would be avaliable in this context, it is fetched again to make sure it is up to date + let options = r.options + if (instanceDiv.checked) options[frontend][instanceNetwork].enabled.push(instance) + else options[frontend][instanceNetwork].enabled.splice(options[frontend][instanceNetwork].enabled.indexOf(instance), 1) + browser.storage.local.set({ options }) + }) + }) + break + } + } + document.getElementById("instance-div").classList.remove("hide") } divs[service].current.classList.remove("hide") divs[service].all.classList.add("hide") diff --git a/src/pages/popup/style.css b/src/pages/popup/style.css index 0cb27912..3b409be8 100644 --- a/src/pages/popup/style.css +++ b/src/pages/popup/style.css @@ -22,3 +22,43 @@ body { .space { height: 10px; } + +input { + height: 23px; + width: 46px; +} + +#instance { + max-width: 110px; + max-height: 22px; + overflow-x: scroll; + white-space: nowrap; + scrollbar-width: none; + -ms-overflow-style: none; +} + +#instance::-webkit-scrollbar { + display: none; +} + +#instance::before { + background-image: linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)); + position: absolute; + width: 5px; + height: 22px; + content: ""; + display: block; + pointer-events: none; +} + +#end::before { + background-image: linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)); + position: absolute; + width: 5px; + height: 22px; + content: ""; + display: block; + pointer-events: none; + top: 13px; + left: 157.4px; +} -- cgit 1.4.1 From 96f6ca4c223c377debd2d1d5a1ffdd39979c2755 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sun, 9 Oct 2022 13:56:04 +0100 Subject: Updated instances --- src/config/config.json | 2 +- src/instances/blacklist.json | 14 ++++++++------ src/instances/data.json | 41 ++++++++++++++++++----------------------- src/pages/popup/style.css | 4 ++-- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/config/config.json b/src/config/config.json index 8110748f..bb970525 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -397,7 +397,7 @@ } }, "targets": [ - "^https?:\\/{2}([a-z]+\\.)*quora\\.com.*" + "^https?:\\/{2}([a-z]+\\.)*quora\\.com" ], "name": "Quora", "options": { diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json index 992466d1..8bf43ebf 100644 --- a/src/instances/blacklist.json +++ b/src/instances/blacklist.json @@ -3,11 +3,12 @@ "https://invidious.kavin.rocks", "https://invidious.rhyshl.live", "https://piped.kavin.rocks", + "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", "https://de-piped.shimul.me", - "https://pipedus.palash.dev", "https://watch.whatever.social", + "https://piped.garudalinux.org", "https://y.rivo.lol", "https://nitter.domain.glass", "https://birdsite.xanny.family", @@ -37,6 +38,7 @@ "https://libreddit.eu.org", "https://libreddit.cachyos.org", "https://futureddit.gq", + "https://libreddit.freedit.eu", "https://teddit.domain.glass", "https://teddit.httpjames.space", "https://teddit.encrypted-data.xyz", @@ -66,21 +68,22 @@ ], "offline": [ "https://invidious.rhyshl.live", - "https://invidious.esmailelbob.xyz", "https://proxitok.odyssey346.dev", "https://nhanh.cloud", - "https://nitter.winscloud.net", "https://ntr.odyssey346.dev", + "https://futureddit.gq", "https://teddit.ggc-project.de", + "https://teddit.froth.zone", "https://teddit.tokhmi.xyz", + "https://wiki.privacytools.io", "https://quetre.odyssey346.dev", - "https://simplytranslate.org", - "https://translate.northboot.xyz", "https://st.odyssey346.dev", + "https://translate.projectsegfau.lt", "https://jsearch.pw", "https://searx.gnu.style", "https://searx.semipvt.com", "https://etsi.me", + "https://search.chemicals-in-the-water.eu", "https://search.zzls.xyz", "https://searx.ericaftereric.top", "https://searx.fmac.xyz", @@ -89,7 +92,6 @@ "https://whoogle.esmailelbob.xyz", "https://search.wef.lol", "https://i.bcow.xyz", - "https://i.actionsack.com", "https://lbry.bcow.xyz", "https://beatbump.ml", "https://bw.odyssey346.dev" diff --git a/src/instances/data.json b/src/instances/data.json index cbff9aac..a5a7177e 100644 --- a/src/instances/data.json +++ b/src/instances/data.json @@ -18,9 +18,9 @@ "https://invidious.projectsegfau.lt", "https://invidious.rhyshl.live", "https://inv.privacy.com.de", + "https://invidious.slipfox.xyz", "https://invidious.esmailelbob.xyz", "https://youtube.076.ne.jp", - "https://invidious.slipfox.xyz", "https://invidious.namazso.eu" ], "tor": [ @@ -36,24 +36,28 @@ "http://ng27owmagn5amdm7l5s3rsqxwscl5ynppnis5dqcasogkyxcfqn7psid.onion", "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion" ], - "i2p": [], + "i2p": [ + "http://verni6dr4qxjgjumnvesxerh5rvhv6oy5ddeibaqy5d7tgbiiyfa.b32.i2p" + ], "loki": [] }, "piped": { "clearnet": [ "https://piped.kavin.rocks", + "https://piped.tokhmi.xyz", "https://piped.moomoo.me", "https://piped.mha.fi", "https://de-piped.shimul.me", "https://pipedus.palash.dev", "https://watch.whatever.social", + "https://piped.garudalinux.org", "https://y.rivo.lol", "https://yt.jae.fi", "https://piped.mint.lgbt", "https://il.ax", + "https://piped.esmailelbob.xyz", "https://piped.projectsegfau.lt", "https://piped.privacydev.net", - "https://piped.palveluntarjoaja.eu", "https://piped.smnz.de", "https://piped.adminforge.de", "https://watch.whatevertinfoil.de", @@ -234,7 +238,10 @@ "http://qwikxx2erhx6qrymued6ox2qkf2yeogjwypqvzoif4fqkljixasr6oid.onion", "http://4g47cxugkohbweao2x66nnxxfoe3k7gdfzxej537nhdbwr522sbjxeqd.onion", "http://nt.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion", - "http://tw.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion" + "http://tw.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion", + "http://r2eqimhkvxboaltbdsectoo3hkf476pyemsdykclexzajbfx5v6ojlyd.onion", + "http://li7snkj6oituazbkr5clmilccwwumhd2dntbhttxomy4dfakeeoar4qd.onion", + "http://a5xyidyppowvblric6k6nixgf2eqwnb7zzeaarj7slqbv7tb6ip5t3ad.onion" ], "i2p": [ "http://axd6uavsstsrvstva4mzlzh4ct76rc6zdug3nxdgeitrzczhzf4q.b32.i2p", @@ -302,7 +309,8 @@ "https://futureddit.gq", "https://lr.slipfox.xyz", "https://libreddit.oxymagnesium.com", - "https://reddit.utsav2.dev" + "https://reddit.utsav2.dev", + "https://libreddit.freedit.eu" ], "tor": [ "http://ecue64ybzvn6vjzl37kcsnwt4ycmbsyf74nbttyg7rkc3t3qwnj7mcyd.onion", @@ -522,7 +530,6 @@ "searx": { "clearnet": [ "https://dynabyte.ca", - "https://icanfindit.online", "https://jsearch.pw", "https://search.ethibox.fr", "https://search.snopyta.org", @@ -538,6 +545,7 @@ "https://searx.nakhan.net", "https://searx.netzspielplatz.de", "https://searx.nixnet.services", + "https://searx.rimkus.it", "https://searx.ru", "https://searx.run", "https://searx.semipvt.com", @@ -560,12 +568,12 @@ ], "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", + "http://privateoz3u5utrimal2edr56j3r5caakektxxgixigdkycuxigvquid.onion", "http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion", "http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion", "http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion", "http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion", - "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion", - "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion" + "http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion" ], "i2p": [ "http://ransack.i2p", @@ -633,7 +641,6 @@ "https://searx.orion-hub.fr", "https://searx.priv.pw", "https://searx.prvcy.eu", - "https://searx.rimkus.it", "https://searx.sethforprivacy.com", "https://searx.sev.monster", "https://searx.slipfox.xyz/searx", @@ -656,7 +663,6 @@ "tor": [ "http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion", "http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion", - "http://privateoz3u5utrimal2edr56j3r5caakektxxgixigdkycuxigvquid.onion", "http://b6sxmon57qza6dt36li7huabie5ntrvjr4q5rc2vvbn4hqvzd4phrvyd.onion", "http://searxngg6zleq6ceboe5ltkyo4hyrb3aaycrgzmrljv3jjlb5vcytead.onion", "http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion", @@ -664,6 +670,7 @@ "http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion", "http://searx.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion", "http://searxfilowxokbogygrigir4wqxfxqzuxofxgdon7dg6rsii4yxzytyd.onion", + "http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion", "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion", "http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx", "http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion", @@ -823,10 +830,10 @@ }, "peertube": [ "https://search.joinpeertube.org", + "https://video.bmu.cloud", "https://freedomadultgames.video", "https://tbh.co-shaoghal.net", "https://tube.kansanvalta.org", - "https://duanrra.cf", "https://ytube.retronerd.at", "https://tube.media-techport.de", "https://notobono.de", @@ -844,7 +851,6 @@ "https://videos.im.allmendenetz.de", "https://tube.cyberia.club", "https://casstream.nohost.me", - "https://peertube.as62430.net", "https://peertube.askan.info", "https://apertatube.net", "https://beetoons.tv", @@ -860,7 +866,6 @@ "https://tube-test.apps.education.fr", "https://tube-sciences-technologies.apps.education.fr", "https://tube-institutionnel.apps.education.fr", - "https://trutube.online", "https://tube-cycle-3.apps.education.fr", "https://video.manicphase.me", "https://tubulus.openlatin.org", @@ -893,7 +898,6 @@ "https://jahve.pl", "https://videos.yesil.club", "https://peertube.adjutor.xyz", - "https://peertube.terranout.mine.nu", "https://tube.hunterjozwiak.com", "https://tube-numerique-educatif.apps.education.fr", "https://tube.itsg.host", @@ -928,7 +932,6 @@ "https://seka.pona.la", "https://syop.tv", "https://watch.thelema.social", - "https://tube.miegl.cz", "https://mov.clov.fr", "https://video.vaku.org.ua", "https://videos.trom.lt", @@ -991,7 +994,6 @@ "https://ocfedtest.hosted.spacebear.ee", "https://video.lono.space", "https://mirrored.rocks", - "https://videopen.net", "https://demo.lioncast.org", "https://peertube.get-racing.de", "https://pierre.tube", @@ -1011,14 +1013,12 @@ "https://ptube.horsentiers.fr", "https://video.cnt.social", "https://tube.03281.fspfc.org", - "https://tube.linc.systems", "https://peertube.ketchup.noho.st", "https://yt.x1337x.fr", "https://videos.rabbit-company.com", "https://video.paradigmthreat.net", "https://vid.twhtv.club", "https://video.retroedge.tech", - "https://truvitv.com", "https://pt.ilyamikcoder.com", "https://peertube.sensin.eu", "https://video.sadmin.io", @@ -1084,7 +1084,6 @@ "https://peertube.revelin.fr", "https://peertube.ti-fr.com", "https://video.turbo.chat", - "https://peertube.am-networks.fr", "https://video.chbmeyer.de", "https://video.rs-einrich.de", "https://p2ptv.ru", @@ -1143,7 +1142,6 @@ "https://tube.childrenshealthdefense.eu", "https://stream.litera.tools", "https://peertube.kriom.net", - "https://peertube.grosist.fr", "https://peertube.gemlog.ca", "https://nettube.uc-netcorsoft.de", "https://live.solari.com", @@ -1196,7 +1194,6 @@ "https://video.windfluechter.org", "https://pocketnetpeertube10.nohost.me", "https://tube.io18.top", - "https://peertube.remerge.net", "https://tube.geekyboo.net", "https://notretube.asselma.eu", "https://canal.facil.services", @@ -1482,7 +1479,6 @@ "https://video.mycrowd.ca", "https://kodcast.com", "https://video.altertek.org", - "https://ruraletv.ovh", "https://tube.oisux.org", "https://peertube.louisematic.site", "https://clap.nerv-project.eu", @@ -1667,7 +1663,6 @@ "https://video.vny.fr", "https://peervideo.club", "https://tube.taker.fr", - "https://peertube.co.uk", "https://video.fitchfamily.org", "https://video.fdlibre.eu", "https://peer.philoxweb.be", diff --git a/src/pages/popup/style.css b/src/pages/popup/style.css index 3b409be8..53589738 100644 --- a/src/pages/popup/style.css +++ b/src/pages/popup/style.css @@ -59,6 +59,6 @@ input { content: ""; display: block; pointer-events: none; - top: 13px; - left: 157.4px; + top: 14px; + left: 156px; } -- cgit 1.4.1