diff --git a/src/js/ui/tabs/cookies.js b/src/js/ui/tabs/cookies.js index 716add3..ce256ed 100644 --- a/src/js/ui/tabs/cookies.js +++ b/src/js/ui/tabs/cookies.js @@ -513,7 +513,7 @@ browser.cookies.onChanged.addListener(async({cookie, removed}) => if (removed) { - if (!pmTable.getItem(domain) || !pmTable.getItem(cookie.name, domain)) + if (!pmTable.getItem(domain)) return; if (!domainCounts[domain]) diff --git a/test/puppeteer/cookie.js b/test/puppeteer/cookie.js index 1fc9e28..ab170aa 100644 --- a/test/puppeteer/cookie.js +++ b/test/puppeteer/cookie.js @@ -224,6 +224,14 @@ describe("Testing Cookies tab", () => await page.waitFor(30); equal(await ensureItem("name3", "domain4.com"), false); equal(await ensureItem("domain4.com"), false); + + // Ensure that non expanded domain item is removed on delete + // https://github.com/Privacy-Managers/Privacy-Manager/issues/83 + await addCookie("https://domain4.com", "name1", "value1"); + await page.waitFor(30); + await (await deleteButtonHandle("domain4.com")).click(); + await page.waitFor(30); + equal(await ensureItem("domain4.com"), false); }); it("Deleting cookies should also unset whitelisting", async() =>