diff --git a/instances/data.json b/instances/data.json index f0ee447..cec6ee4 100644 --- a/instances/data.json +++ b/instances/data.json @@ -16,7 +16,7 @@ "https://invidious.privacy.gd", "https://invidious.namazso.eu" ], - "onion": [ + "tor": [ "http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion", "http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion", "http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion", @@ -73,7 +73,7 @@ "https://tw.artemislena.eu", "https://de.nttr.stream" ], - "onion": [ + "tor": [ "http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion", "http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion", "http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion", @@ -126,7 +126,7 @@ "https://teddit.adminforge.de", "https://teddit.bus-hit.me" ], - "onion": [ + "tor": [ "http://teddit4w6cmzmj5kimhfcavs7yo5s7alszvsi2khqutqtlaanpcftfyd.onion", "http://snoo.ioensistjs7wd746zluwixvojbbkxhr37lepdvwtdfeav673o64iflqd.onion", "http://ibarajztopxnuhabfu7fg6gbudynxofbnmvis3ltj6lfx47b6fhrd5qd.onion", @@ -142,7 +142,7 @@ "https://wikiless.sethforprivacy.com", "https://wiki.604kph.xyz" ], - "onion": [ + "tor": [ "http://dj2tbh2nqfxyfmvq33cjmhuw7nb6am7thzd3zsjvizeqf374fixbrxyd.onion" ] }, @@ -166,7 +166,7 @@ "https://simplytranslate.pussthecat.org", "https://translate.northboot.xyz" ], - "onion": [ + "tor": [ "http://fyng2tsmzmvxmojzbbwmfnsn2lrcyftf4cw6rk5j2v2huliazud3fjid.onion", "http://xxtbwyb5z5bdvy2f6l2yquu5qilgkjeewno4qfknvb3lkg3nmoklitid.onion" ] @@ -276,7 +276,7 @@ "https://xeek.com", "https://searx.roflcopter.fr" ], - "onion": [ + "tor": [ "http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion", "http://searxbgetrkiwxhdwi6svpgh7eotopqyxhbqiokrwzg7dcte44t36kyd.onion", "http://suche.xyzco456vwisukfg.onion", @@ -321,7 +321,7 @@ "https://rimgo.totaldarkness.net", "https://rimgo.bus-hit.me" ], - "onion": [ + "tor": [ "http://l4d4owboqr6xcmd6lf64gbegel62kbudu3x3jnldz2mx6mhn3bsv3zyd.onion", "http://jx3dpcwedpzu2mh54obk5gvl64i2ln7pt5mrzd75s4jnndkqwzaim7ad.onion" ] diff --git a/src/assets/javascripts/helpers/common.js b/src/assets/javascripts/helpers/common.js index 05ad60f..4c27f16 100644 --- a/src/assets/javascripts/helpers/common.js +++ b/src/assets/javascripts/helpers/common.js @@ -90,6 +90,7 @@ function isFirefox() { function processDefaultCustomInstances( name, + protocol, nameHelper, document, getNameRedirectsChecks, @@ -99,32 +100,33 @@ function processDefaultCustomInstances( ) { let nameCustomInstances = []; - let nameCheckListElement = document.getElementById(`${name}-checklist`); + let nameCheckListElement = document.getElementById(`${name}-${protocol}-checklist`); let nameDefaultRedirects; function calcNameCheckBoxes() { let isTrue = true; - for (const item of nameHelper.getRedirects()[name].normal) + for (const item of nameHelper.getRedirects()[name][protocol]) if (!nameDefaultRedirects.includes(item)) { isTrue = false; break; } for (const element of nameCheckListElement.getElementsByTagName('input')) element.checked = nameDefaultRedirects.includes(element.id) - document.getElementById(`${name}-toogle-all`).checked = isTrue; + document.getElementById(`${name}-${protocol}-toogle-all`).checked = isTrue; } nameDefaultRedirects = getNameRedirectsChecks(); + nameCheckListElement.innerHTML = [ - `
Toggle All
`, - ...nameHelper.getRedirects()[name].normal.map((x) => `
${x}
`), + `
Toggle All
`, + ...nameHelper.getRedirects()[name][protocol].map((x) => `
${x}
`), ].join('\n
\n'); calcNameCheckBoxes(); - document.getElementById(`${name}-toogle-all`).addEventListener("change", (event) => { + document.getElementById(`${name}-${protocol}-toogle-all`).addEventListener("change", (event) => { if (event.target.checked) - nameDefaultRedirects = [...nameHelper.getRedirects()[name].normal]; + nameDefaultRedirects = [...nameHelper.getRedirects()[name][protocol]]; else nameDefaultRedirects = []; setNameRedirectsChecks(nameDefaultRedirects); @@ -132,7 +134,7 @@ function processDefaultCustomInstances( }); for (let element of nameCheckListElement.getElementsByTagName('input')) { - if (element.id != `${name}-toogle-all`) + if (element.id != `${name}-${protocol}-toogle-all`) document.getElementById(element.id).addEventListener("change", (event) => { if (event.target.checked) nameDefaultRedirects.push(element.id) @@ -147,7 +149,7 @@ function processDefaultCustomInstances( nameCustomInstances = getNameCustomRedirects(); function calcNameCustomInstances() { - document.getElementById(`${name}-custom-checklist`).innerHTML = + document.getElementById(`${name}-${protocol}-custom-checklist`).innerHTML = nameCustomInstances.map( (x) => `
${x}
+
+

Protocol

+ +
+
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
+
+
- - +

Default Instances

- -
+
+
+
+

Custom Instances

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

Default Tor Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
diff --git a/src/pages/options/twitter/twitter.js b/src/pages/options/twitter/twitter.js index 759ad57..88fadb7 100644 --- a/src/pages/options/twitter/twitter.js +++ b/src/pages/options/twitter/twitter.js @@ -6,16 +6,54 @@ disableTwitterElement.addEventListener("change", (event) => twitterHelper.setDisable(!event.target.checked) ); +let protocolElement = document.getElementById("protocol") +protocolElement.addEventListener("change", + (event) => { + let protocol = event.target.options[protocolElement.selectedIndex].value + twitterHelper.setProtocol(protocol); + changeProtocolSettings(protocol); + } +); + + +function changeProtocolSettings(protocol) { + let normalDiv = document.getElementById("normal"); + let torDiv = document.getElementById("tor"); + if (protocol == 'normal') { + normalDiv.style.display = 'block'; + torDiv.style.display = 'none'; + } + else if (protocol == 'tor') { + normalDiv.style.display = 'none'; + torDiv.style.display = 'block'; + } +} + twitterHelper.init().then(() => { - disableTwitterElement.checked = !twitterHelper.getDisable(); + disableTwitterElement.checked = !twitterHelper.getDisable(); + + let protocol = twitterHelper.getprotocol(); + protocolElement.value = protocol; + changeProtocolSettings(protocol); commonHelper.processDefaultCustomInstances( 'nitter', + 'normal', twitterHelper, document, - twitterHelper.getNitterRedirectsChecks, - twitterHelper.setNitterRedirectsChecks, - twitterHelper.getNitterCustomRedirects, - twitterHelper.setNitterCustomRedirects + twitterHelper.getNitterNormalRedirectsChecks, + twitterHelper.setNitterNormalRedirectsChecks, + twitterHelper.getNitterNormalCustomRedirects, + twitterHelper.setNitterNormalCustomRedirects + ) + commonHelper.processDefaultCustomInstances( + 'nitter', + 'tor', + twitterHelper, + document, + twitterHelper.getNitterTorRedirectsChecks, + twitterHelper.setNitterTorRedirectsChecks, + twitterHelper.getNitterTorCustomRedirects, + twitterHelper.setNitterTorCustomRedirects ) }); \ No newline at end of file diff --git a/src/pages/options/wikipedia/wikipedia.js b/src/pages/options/wikipedia/wikipedia.js index 5abaed6..161f0af 100644 --- a/src/pages/options/wikipedia/wikipedia.js +++ b/src/pages/options/wikipedia/wikipedia.js @@ -10,6 +10,7 @@ wikipediaHelper.init().then(() => { commonHelper.processDefaultCustomInstances( 'wikiless', + 'normal', wikipediaHelper, document, wikipediaHelper.getWikilessRedirectsChecks, diff --git a/src/pages/options/youtube/invidious.js b/src/pages/options/youtube/invidious.js index 70b2542..17cbda3 100644 --- a/src/pages/options/youtube/invidious.js +++ b/src/pages/options/youtube/invidious.js @@ -26,6 +26,7 @@ persistInvidiousPrefsElement.addEventListener("change", (event) => youtubeHelper.setPersistInvidiousPrefs(event.target.checked) ); + youtubeHelper.init().then(() => { invidiousPlayerStyleElement.value = youtubeHelper.getInvidiousPlayerStyle(); invidiousAlwaysProxyElement.checked = youtubeHelper.getInvidiousAlwaysProxy(); @@ -35,12 +36,24 @@ youtubeHelper.init().then(() => { commonHelper.processDefaultCustomInstances( 'invidious', + 'normal', youtubeHelper, document, - youtubeHelper.getInvidiousRedirectsChecks, - youtubeHelper.setInvidiousRedirectsChecks, - youtubeHelper.getInvidiousCustomRedirects, - youtubeHelper.setInvidiousCustomRedirects - ) + youtubeHelper.getInvidiousNormalRedirectsChecks, + youtubeHelper.setInvidiousNormalRedirectsChecks, + youtubeHelper.getInvidiousNormalCustomRedirects, + youtubeHelper.setInvidiousNormalCustomRedirects + ); + + commonHelper.processDefaultCustomInstances( + 'invidious', + 'tor', + youtubeHelper, + document, + youtubeHelper.getInvidiousTorRedirectsChecks, + youtubeHelper.setInvidiousTorRedirectsChecks, + youtubeHelper.getInvidiousTorCustomRedirects, + youtubeHelper.setInvidiousTorCustomRedirects + ); }); diff --git a/src/pages/options/youtube/piped.js b/src/pages/options/youtube/piped.js index ed42523..6c541a8 100644 --- a/src/pages/options/youtube/piped.js +++ b/src/pages/options/youtube/piped.js @@ -4,13 +4,24 @@ import commonHelper from "../../../assets/javascripts/helpers/common.js"; youtubeHelper.init().then(() => { commonHelper.processDefaultCustomInstances( 'piped', + 'normal', youtubeHelper, document, - youtubeHelper.getPipedRedirectsChecks, - youtubeHelper.setPipedRedirectsChecks, - youtubeHelper.getPipedCustomRedirects, - youtubeHelper.setPipedCustomRedirects - ) + youtubeHelper.getPipedNormalRedirectsChecks, + youtubeHelper.setPipedNormalRedirectsChecks, + youtubeHelper.getPipedNormalCustomRedirects, + youtubeHelper.setPipedNormalCustomRedirects + ); + commonHelper.processDefaultCustomInstances( + 'piped', + 'tor', + youtubeHelper, + document, + youtubeHelper.getPipedTorRedirectsChecks, + youtubeHelper.setPipedTorRedirectsChecks, + youtubeHelper.getPipedTorCustomRedirects, + youtubeHelper.setPipedTorCustomRedirects + ); }); diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html index 2d8c75e..cc5cf05 100644 --- a/src/pages/options/youtube/youtube.html +++ b/src/pages/options/youtube/youtube.html @@ -138,6 +138,15 @@
+ +
+

Protocol

+ +
+

Redirect Type

- +

Default Instances

- -
+
+
+
+
+

Custom Instances

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

Default Instances

+
+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+

-
-

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
+
- - +

Default Instances

- -
+
+
+
+
+

Custom Instances

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

Default Instances

+
+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
diff --git a/src/pages/options/youtube/youtube.js b/src/pages/options/youtube/youtube.js index 61d2ec5..d62bdad 100644 --- a/src/pages/options/youtube/youtube.js +++ b/src/pages/options/youtube/youtube.js @@ -103,6 +103,35 @@ alwaysUsePreferredElement.addEventListener("change", (event) => youtubeHelper.setAlwaysusePreferred(event.target.checked) ); +let protocolElement = document.getElementById("protocol") +protocolElement.addEventListener("change", + (event) => { + let protocol = event.target.options[protocolElement.selectedIndex].value + youtubeHelper.setProtocol(protocol); + changeProtocolSettings(protocol); + } +); + +function changeProtocolSettings(protocol) { + let normalPipedDiv = document.getElementById("piped-normal"); + let torPipedDiv = document.getElementById("piped-tor"); + + let normalInvidiousDiv = document.getElementById("invidious-normal"); + let torInvidiousDiv = document.getElementById("invidious-tor"); + if (protocol == 'normal') { + normalPipedDiv.style.display = 'block'; + normalInvidiousDiv.style.display = 'block'; + torInvidiousDiv.style.display = 'none'; + torPipedDiv.style.display = 'none'; + } + else if (protocol == 'tor') { + normalPipedDiv.style.display = 'none'; + normalInvidiousDiv.style.display = 'none'; + torInvidiousDiv.style.display = 'block'; + torPipedDiv.style.display = 'block'; + } +} + youtubeHelper.init().then(() => { disableYoutubeElement.checked = !youtubeHelper.getDisable(); themeElement.checked = youtubeHelper.getTheme(); @@ -115,6 +144,10 @@ youtubeHelper.init().then(() => { youtubeFrontendElement.value = frontend; changeFrontendsSettings(frontend); + let protocol = youtubeHelper.getprotocol(); + protocolElement.value = protocol; + changeProtocolSettings(protocol); + let freetubeFrontend = youtubeHelper.getFreetubeFrontend() freetubeFrontendElement.value = freetubeFrontend if (frontend == "freetube") changeFreetubeFrontendsSettings(freetubeFrontend); diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index f42a088..8cf52e3 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -141,35 +141,18 @@

Medium

-
- More Options  - - - - + Settings  + + + +
diff --git a/src/pages/popup/style.css b/src/pages/popup/style.css index 05c3947..f223ec5 100644 --- a/src/pages/popup/style.css +++ b/src/pages/popup/style.css @@ -1,5 +1,4 @@ body { width: 230px; min-height: auto; - background-color: var(--bg-main); } \ No newline at end of file