diff --git a/src/js/background/assignManager.js b/src/js/background/assignManager.js index 032adb1f..d2aa8048 100644 --- a/src/js/background/assignManager.js +++ b/src/js/background/assignManager.js @@ -705,9 +705,8 @@ window.assignManager = { return browser.tabs.create({url, cookieStoreId, index, active, openerTabId}); } else { let confirmUrl = `${loadPage}?url=${this.encodeURLProperty(url)}&cookieStoreId=${cookieStoreId}`; - let currentCookieStoreId; - if (currentUserContextId) { - currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId); + const currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId); + if (parseInt(currentUserContextId, 10) > 0) { confirmUrl += `¤tCookieStoreId=${currentCookieStoreId}`; } return browser.tabs.create({ diff --git a/src/js/background/backgroundLogic.js b/src/js/background/backgroundLogic.js index 76432216..d0ef360c 100644 --- a/src/js/background/backgroundLogic.js +++ b/src/js/background/backgroundLogic.js @@ -32,6 +32,9 @@ const backgroundLogic = { if (!cookieStoreId) { return false; } + if (cookieStoreId === "firefox-default") { + return "0"; + } const container = cookieStoreId.replace("firefox-container-", ""); if (container !== cookieStoreId) { return container; @@ -357,7 +360,7 @@ const backgroundLogic = { }, cookieStoreId(userContextId) { - if(userContextId === 0) return "firefox-default"; + if (parseInt(userContextId, 10) === 0) return "firefox-default"; return `firefox-container-${userContextId}`; } };