diff --git a/.eslintrc.js b/.eslintrc.js
index f2a7957..d9f7270 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -9,6 +9,7 @@ module.exports = {
"webextensions": true
},
"globals": {
+ "Utils": true,
"CustomizableUI": true,
"CustomizableWidgets": true,
"SessionStore": true,
diff --git a/webextension/background.js b/webextension/background.js
index c6c9d37..ebedf66 100644
--- a/webextension/background.js
+++ b/webextension/background.js
@@ -162,7 +162,7 @@ const assignManager = {
} else {
remove = true;
}
- await this._setOrRemoveAssignment(info.pageUrl, userContextId, remove);
+ await this._setOrRemoveAssignment(tab.id, info.pageUrl, userContextId, remove);
this.calculateContextMenu(tab);
}
},
@@ -195,7 +195,7 @@ const assignManager = {
return true;
},
- async _setOrRemoveAssignment(pageUrl, userContextId, remove) {
+ async _setOrRemoveAssignment(tabId, pageUrl, userContextId, remove) {
let actionName;
if (!remove) {
await this.storageArea.set(pageUrl, {
@@ -208,11 +208,8 @@ const assignManager = {
await this.storageArea.remove(pageUrl);
actionName = "removed";
}
- browser.notifications.create({
- type: "basic",
- title: "Containers",
- message: `Successfully ${actionName} site to always open in this container`,
- iconUrl: browser.extension.getURL("/img/onboarding-1.png")
+ browser.tabs.sendMessage(tabId, {
+ text: `Successfully ${actionName} site to always open in this container`
});
backgroundLogic.sendTelemetryPayload({
event: `${actionName}-container-assignment`,
@@ -444,7 +441,10 @@ const messageHandler = {
response = assignManager._getByContainer(m.message.userContextId);
break;
case "setOrRemoveAssignment":
- response = assignManager._setOrRemoveAssignment(m.url, m.userContextId, m.value);
+ response = browser.tabs.get(m.tabId).then((tab) => {
+ const userContextId = assignManager.getUserContextIdFromCookieStore(tab);
+ return assignManager._setOrRemoveAssignment(tab.id, tab.url, userContextId, m.value);
+ });
break;
case "exemptContainerAssignment":
response = assignManager._exemptTab(m);
diff --git a/webextension/confirm-page.html b/webextension/confirm-page.html
index 09d4852..20d11c8 100644
--- a/webextension/confirm-page.html
+++ b/webextension/confirm-page.html
@@ -27,6 +27,7 @@
+