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