Added clean up of proxy association after container deletion
This commit is contained in:
parent
8ee45a38f0
commit
f47b4c8f6c
2 changed files with 7 additions and 3 deletions
|
@ -32,6 +32,10 @@ const backgroundLogic = {
|
||||||
await browser.contextualIdentities.remove(this.cookieStoreId(userContextId));
|
await browser.contextualIdentities.remove(this.cookieStoreId(userContextId));
|
||||||
}
|
}
|
||||||
assignManager.deleteContainer(userContextId);
|
assignManager.deleteContainer(userContextId);
|
||||||
|
|
||||||
|
// Now remove the identity->proxy association in proxifiedContainers also
|
||||||
|
proxifiedContainers.delete(this.cookieStoreId(userContextId));
|
||||||
|
|
||||||
return {done: true, userContextId};
|
return {done: true, userContextId};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -148,17 +148,17 @@ proxifiedContainers = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Deletes the proxy information object for a specified cookieStoreId [useful for cleaning]
|
// Deletes the proxy information object for a specified cookieStoreId [useful for cleaning]
|
||||||
delete(cookieStoreId) {
|
delete(cookieStoreId) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Assumes proxy is a properly formatted object
|
// Assumes proxy is a properly formatted object
|
||||||
proxifiedContainers.retrieve().then((proxifiedContainersStore) => {
|
proxifiedContainers.retrieve().then((proxifiedContainersStore) => {
|
||||||
let index = proxifiedContainersStore.findIndex(i => i.cookieStoreId === cookieStoreId);
|
const index = proxifiedContainersStore.findIndex(i => i.cookieStoreId === cookieStoreId);
|
||||||
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
reject({error: "not-found", message: `Container '${cookieStoreId}' not found.`});
|
reject({error: "not-found", message: `Container '${cookieStoreId}' not found.`});
|
||||||
} else {
|
} else {
|
||||||
delete proxifiedContainersStore[index];
|
proxifiedContainersStore.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
browser.storage.local.set({
|
browser.storage.local.set({
|
||||||
|
|
Loading…
Add table
Reference in a new issue