This commit is contained in:
Garry W 2025-05-21 10:43:17 +10:00 committed by GitHub
commit 490a2c3f53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -808,9 +808,8 @@ window.assignManager = {
return this.createTabWrapper(url, cookieStoreId, index, active, openerTabId, groupId); return this.createTabWrapper(url, cookieStoreId, index, active, openerTabId, groupId);
} else { } else {
let confirmUrl = `${loadPage}?url=${this.encodeURLProperty(url)}&cookieStoreId=${cookieStoreId}`; let confirmUrl = `${loadPage}?url=${this.encodeURLProperty(url)}&cookieStoreId=${cookieStoreId}`;
let currentCookieStoreId; const currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId);
if (currentUserContextId) { if (parseInt(currentUserContextId, 10) > 0) {
currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId);
confirmUrl += `&currentCookieStoreId=${currentCookieStoreId}`; confirmUrl += `&currentCookieStoreId=${currentCookieStoreId}`;
} }
return this.createTabWrapper( return this.createTabWrapper(

View file

@ -121,6 +121,9 @@ const backgroundLogic = {
if (!cookieStoreId) { if (!cookieStoreId) {
return false; return false;
} }
if (cookieStoreId === "firefox-default") {
return "0";
}
const container = cookieStoreId.replace("firefox-container-", ""); const container = cookieStoreId.replace("firefox-container-", "");
if (container !== cookieStoreId) { if (container !== cookieStoreId) {
return container; return container;
@ -481,7 +484,7 @@ const backgroundLogic = {
}, },
cookieStoreId(userContextId) { cookieStoreId(userContextId) {
if(userContextId === 0) return "firefox-default"; if (parseInt(userContextId, 10) === 0) return "firefox-default";
return `firefox-container-${userContextId}`; return `firefox-container-${userContextId}`;
} }
}; };

View file

@ -73,7 +73,7 @@ describe("Assignment Comfirm Page Feature", function () {
url: "moz-extension://fake/confirm-page.html?" + url: "moz-extension://fake/confirm-page.html?" +
`url=${encodeURIComponent(url)}` + `url=${encodeURIComponent(url)}` +
`&cookieStoreId=${this.webExt.tab.cookieStoreId}`, `&cookieStoreId=${this.webExt.tab.cookieStoreId}`,
cookieStoreId: undefined, cookieStoreId: "firefox-default",
openerTabId: null, openerTabId: null,
index: 2, index: 2,
active: true active: true