Removed FPI settings unifying as it superceded by dFPI & ETP

This commit is contained in:
Hygna 2022-10-15 16:02:59 +01:00
parent ea4126d75e
commit 88e72a80b6
No known key found for this signature in database
5 changed files with 21 additions and 44 deletions

View File

@ -33,7 +33,6 @@ async function initDefaults() {
theme: "detect",
popupServices: ["youtube", "twitter", "instagram", "tiktok", "imgur", "reddit", "quora", "translate", "maps"],
autoRedirect: false,
firstPartyIsolate: false,
network: "clearnet",
networkFallback: true,
latencyThreshold: 1000,

View File

@ -521,7 +521,7 @@ function unifyPreferences(url, tabId) {
const frontendObject = config.services[service].frontends[frontend]
if ("cookies" in frontendObject.preferences) {
for (const cookie of frontendObject.preferences.cookies) {
await utils.copyCookie(frontendObject, url, instancesList, cookie)
await utils.copyCookie(url, instancesList, cookie)
}
}
if ("localstorage" in frontendObject.preferences) {
@ -652,7 +652,6 @@ function upgradeOptions() {
options.popupServices.splice(tmp, 1)
options.popupServices.push("sendFiles")
}
options.firstPartyIsolate = r.firstPartyIsolate
options.autoRedirect = r.autoRedirect
switch (r.onlyEmbeddedVideo) {
case "onlyNotEmbedded":

View File

@ -280,46 +280,28 @@ async function testLatency(element, instances, frontend) {
})
}
function copyCookie(frontend, targetUrl, urls, name) {
function copyCookie(targetUrl, urls, name) {
return new Promise(resolve => {
browser.storage.local.get("options", r => {
let query
if (!r.options.firstPartyIsolate)
query = {
url: protocolHost(targetUrl),
name: name,
}
else
query = {
url: protocolHost(targetUrl),
name: name,
firstPartyDomain: null,
}
browser.cookies.getAll(query, async cookies => {
for (const cookie of cookies)
if (cookie.name == name) {
for (const url of urls) {
const setQuery = r.options.firstPartyIsolate
? {
url: url,
name: name,
value: cookie.value,
secure: true,
firstPartyDomain: new URL(url).hostname,
}
: {
url: url,
name: name,
value: cookie.value,
secure: true,
expirationDate: cookie.expirationDate,
}
browser.cookies.set(setQuery)
const query = {
url: protocolHost(targetUrl),
name: name,
}
browser.cookies.getAll(query, async cookies => {
for (const cookie of cookies)
if (cookie.name == name) {
for (const url of urls) {
const setQuery = {
url: url,
name: name,
value: cookie.value,
secure: true,
expirationDate: cookie.expirationDate,
}
break
browser.cookies.set(setQuery)
}
resolve()
})
break
}
resolve()
})
})
}

View File

@ -138,7 +138,7 @@
],
"indexeddb": "hyperpipedb"
},
"name": "HyperPipe",
"name": "Hyperpipe",
"instanceList": true
}
},

View File

@ -170,8 +170,6 @@ for (const service in config.services) {
})
})
}
// const firstPartyIsolate = document.getElementById('firstPartyIsolate');
// firstPartyIsolate.addEventListener("change", () => browser.storage.local.set({ firstPartyIsolate: firstPartyIsolate.checked }))
browser.storage.local.get("options", r => {
autoRedirectElement.checked = r.options.autoRedirect
@ -180,7 +178,6 @@ browser.storage.local.get("options", r => {
networkFallbackCheckbox.checked = r.options.networkFallback
latencyOutput.value = r.options.latencyThreshold
let options = r.options
// firstPartyIsolate.checked = r.firstPartyIsolate;
//let networkFallbackElement = document.getElementById("network-fallback")
if (networkElement.value == "clearnet") {