This commit is contained in:
ManeraKai 2022-08-02 18:09:24 +03:00 committed by BobIsMyManager
parent 6a1ac04791
commit 8ea4d37b43
4 changed files with 177 additions and 187 deletions

View File

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

View File

@ -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)
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)
const preferences = http.responseText
//console.log(preferences)
browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: preferences }, () => resolve()))
break
}
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,

View File

@ -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"
]
}

View File

@ -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"
]
}