Fix simplytranslate and make things prettier

This commit is contained in:
BobIsMyManager 2022-08-02 23:04:04 +01:00
parent b1ebf0e2de
commit 9959aeb4ea
20 changed files with 244 additions and 246 deletions

View File

@ -32,7 +32,7 @@ async function initDefaults() {
firstPartyIsolate: false,
protocol: "normal",
protocolFallback: true,
latencyThreshold: 1000
latencyThreshold: 1000,
},
() => resolve()
)

View File

@ -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,
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: [],
libremdbNormalRedirectsChecks,
libremdbNormalCustomRedirects: [],
libremdbTorRedirectsChecks: [...redirects.libremdb.tor],
libremdbTorCustomRedirects: [],
libremdbTorRedirectsChecks: [...redirects.libremdb.tor],
libremdbTorCustomRedirects: [],
libremdbI2pRedirectsChecks: [],
libremdbI2pCustomRedirects: [],
libremdbI2pRedirectsChecks: [],
libremdbI2pCustomRedirects: [],
libremdbLokiRedirectsChecks: [],
libremdbLokiCustomRedirects: [],
},
() => resolve()
)
})
libremdbLokiRedirectsChecks: [],
libremdbLokiCustomRedirects: [],
},
() => resolve()
)
})
})
})
}

View File

@ -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,

View File

@ -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,

View File

@ -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",
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: [],
librarianNormalRedirectsChecks,
librarianNormalCustomRedirects: [],
librarianTorRedirectsChecks: [...redirects.librarian.tor],
librarianTorCustomRedirects: [],
librarianTorRedirectsChecks: [...redirects.librarian.tor],
librarianTorCustomRedirects: [],
librarianI2pRedirectsChecks: [...redirects.librarian.i2p],
librarianI2pCustomRedirects: [],
librarianI2pRedirectsChecks: [...redirects.librarian.i2p],
librarianI2pCustomRedirects: [],
librarianLokiRedirectsChecks: [...redirects.librarian.loki],
librarianLokiCustomRedirects: [],
},
() => resolve()
)
})
librarianLokiRedirectsChecks: [...redirects.librarian.loki],
librarianLokiCustomRedirects: [],
},
() => resolve()
)
})
})
})
}

View File

@ -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: [],
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: [],
facilTorRedirectsChecks: [...redirects.facil.tor],
facilTorCustomRedirects: [],
facilI2pRedirectsChecks: [...redirects.facil.i2p],
facilI2pCustomRedirects: [],
facilI2pRedirectsChecks: [...redirects.facil.i2p],
facilI2pCustomRedirects: [],
facilLokiRedirectsChecks: [...redirects.facil.loki],
facilLokiCustomRedirects: [],
},
() => resolve()
)
})
facilLokiRedirectsChecks: [...redirects.facil.loki],
facilLokiCustomRedirects: [],
},
() => resolve()
)
})
})
})
}

View File

@ -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,

View File

@ -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],

View File

@ -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,
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,
quoraRedirects: redirects,
quetreNormalRedirectsChecks,
quetreNormalCustomRedirects: [],
quetreNormalRedirectsChecks,
quetreNormalCustomRedirects: [],
quetreTorRedirectsChecks: [...redirects.quetre.tor],
quetreTorCustomRedirects: [],
quetreTorRedirectsChecks: [...redirects.quetre.tor],
quetreTorCustomRedirects: [],
quetreI2pRedirectsChecks: [...redirects.quetre.i2p],
quetreI2pCustomRedirects: [],
quetreI2pRedirectsChecks: [...redirects.quetre.i2p],
quetreI2pCustomRedirects: [],
quetreLokiRedirectsChecks: [...redirects.quetre.loki],
quetreLokiCustomRedirects: [],
},
() => resolve()
)
})
quetreLokiRedirectsChecks: [...redirects.quetre.loki],
quetreLokiCustomRedirects: [],
},
() => resolve()
)
})
})
})
}

View File

@ -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)
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)
}
const b = tedditNormalRedirectsChecks.indexOf(instance)
if (b > -1) tedditNormalRedirectsChecks.splice(b, 1)
}
browser.storage.local.set(
{
disableReddit: false,

View File

@ -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,
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,
reutersRedirects: redirects,
neutersNormalRedirectsChecks,
neutersNormalCustomRedirects: [],
neutersNormalRedirectsChecks,
neutersNormalCustomRedirects: [],
neutersTorRedirectsChecks: [...redirects.neuters.tor],
neutersTorCustomRedirects: [],
neutersTorRedirectsChecks: [...redirects.neuters.tor],
neutersTorCustomRedirects: [],
neutersI2pRedirectsChecks: [...redirects.neuters.i2p],
neutersI2pCustomRedirects: [],
neutersI2pRedirectsChecks: [...redirects.neuters.i2p],
neutersI2pCustomRedirects: [],
neutersLokiRedirectsChecks: [...redirects.neuters.loki],
neutersLokiCustomRedirects: [],
},
() => resolve()
)
})
neutersLokiRedirectsChecks: [...redirects.neuters.loki],
neutersLokiCustomRedirects: [],
},
() => resolve()
)
})
})
})
}

View File

@ -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,

View File

@ -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,

View File

@ -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,
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,
tiktokRedirects: redirects,
proxiTokNormalRedirectsChecks,
proxiTokNormalCustomRedirects: [],
proxiTokNormalRedirectsChecks,
proxiTokNormalCustomRedirects: [],
proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor],
proxiTokTorCustomRedirects: [],
proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor],
proxiTokTorCustomRedirects: [],
proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p],
proxiTokI2pCustomRedirects: [],
proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p],
proxiTokI2pCustomRedirects: [],
proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki],
proxiTokLokiCustomRedirects: [],
},
() => resolve()
)
})
proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki],
proxiTokLokiCustomRedirects: [],
},
() => resolve()
)
})
})
})
}

View File

@ -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)
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)
}
const b = lingvaNormalRedirectsChecks.indexOf(instance)
if (b > -1) lingvaNormalRedirectsChecks.splice(b, 1)
}
browser.storage.local.set(
{
translateDisable: false,

View File

@ -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()
)
})
})
})
})
}

View File

@ -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)

View File

@ -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,

View File

@ -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],
})
})
}

View File

@ -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)
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)
}
const b = hyperpipeNormalRedirectsChecks.indexOf(instance)
if (b > -1) hyperpipeNormalRedirectsChecks.splice(b, 1)
}
browser.storage.local.set(
{
disableYoutubeMusic: false,