From 024fb03c337f236b207cf4c20250a18e62fa831c Mon Sep 17 00:00:00 2001 From: Maxx Crawford Date: Wed, 15 Jul 2020 10:41:12 -0500 Subject: [PATCH 1/2] Fixed #1781 - Reset checkbox listener to keep event queue to 0 --- src/js/popup.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index bc5109e..259d7c9 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -30,6 +30,13 @@ const P_CONTAINER_DELETE = "containerDelete"; const P_CONTAINERS_ACHIEVEMENT = "containersAchievement"; const P_CONTAINER_ASSIGNMENTS = "containerAssignments"; +function addRemoveSiteIsolation() { + const identity = Logic.currentIdentity(); + browser.runtime.sendMessage({ + method: "addRemoveSiteIsolation", + cookieStoreId: identity.cookieStoreId + }); +} async function getExtensionInfo() { const manifestPath = browser.extension.getURL("manifest.json"); @@ -1242,6 +1249,9 @@ Logic.registerPanel(P_CONTAINER_EDIT, { initialize() { this.initializeRadioButtons(); Utils.addEnterHandler(document.querySelector("#close-container-edit-panel"), () => { + // Resets listener from siteIsolation checkbox to keep the update queue to 0. + const siteIsolation = document.querySelector("#site-isolation"); + siteIsolation.removeEventListener("change", addRemoveSiteIsolation, false); const formValues = new FormData(this._editForm); if (formValues.get("container-id") !== NEW_CONTAINER_ID) { this._submitForm(); @@ -1337,14 +1347,10 @@ Logic.registerPanel(P_CONTAINER_EDIT, { containerName.select(); containerName.focus(); }); + const siteIsolation = document.querySelector("#site-isolation"); siteIsolation.checked = !!identity.isIsolated; - siteIsolation.addEventListener( "change", function() { - browser.runtime.sendMessage({ - method: "addRemoveSiteIsolation", - cookieStoreId: identity.cookieStoreId - }); - }); + siteIsolation.addEventListener( "change", addRemoveSiteIsolation, false); [...document.querySelectorAll("[name='container-color']")].forEach(colorInput => { colorInput.checked = colorInput.value === identity.color; }); From b6f3c1599984e042de35281e44827fb3012c44b2 Mon Sep 17 00:00:00 2001 From: Maxx Crawford Date: Wed, 15 Jul 2020 10:42:08 -0500 Subject: [PATCH 2/2] Bumped version number for patch --- package.json | 2 +- src/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 27e53c2..8f145cf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "testpilot-containers", "title": "Multi-Account Containers", "description": "Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate.", - "version": "7.0.1", + "version": "7.0.2", "author": "Andrea Marchesini, Luke Crouch and Jonathan Kingston", "bugs": { "url": "https://github.com/mozilla/multi-account-containers/issues" diff --git a/src/manifest.json b/src/manifest.json index 24488d8..0bbb9ee 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Firefox Multi-Account Containers", - "version": "7.0.1", + "version": "7.0.2", "incognito": "not_allowed", "description": "Multi-Account Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate.", "icons": {