Removing all duplicate cookies before Unifying #323
This commit is contained in:
parent
0646598478
commit
eeb01729ea
@ -287,7 +287,6 @@ async function testLatency(element, instances) {
|
|||||||
function copyCookie(frontend, targetUrl, urls, name) {
|
function copyCookie(frontend, targetUrl, urls, name) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
browser.storage.local.get('firstPartyIsolate', r => {
|
browser.storage.local.get('firstPartyIsolate', r => {
|
||||||
console.log('r.firstPartyIsolate', r.firstPartyIsolate);
|
|
||||||
let query;
|
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), name: name, firstPartyDomain: null }
|
else query = { url: protocolHost(targetUrl), name: name, firstPartyDomain: null }
|
||||||
@ -313,10 +312,13 @@ function copyCookie(frontend, targetUrl, urls, name) {
|
|||||||
firstPartyDomain: new URL(url).hostname,
|
firstPartyDomain: new URL(url).hostname,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
browser.cookies.remove(removeQuery, () => {
|
function removeCookie() {
|
||||||
browser.cookies.set(setQuery, () => {
|
return new Promise(resolve => browser.cookies.remove(removeQuery, resolve))
|
||||||
|
}
|
||||||
|
|
||||||
|
browser.cookies.set(setQuery, async () => {
|
||||||
|
while (await removeCookie() != null) continue;
|
||||||
browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())
|
browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve())
|
||||||
})
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user