Skip to content

Commit ab5d67e

Browse files
committed
fix can't open in default container if url assigned to a container
associate userContextId=0 with CookieStoreId="firefox-default"
1 parent 4b56a2f commit ab5d67e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/js/background/assignManager.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,8 @@ window.assignManager = {
705705
return browser.tabs.create({url, cookieStoreId, index, active, openerTabId});
706706
} else {
707707
let confirmUrl = `${loadPage}?url=${this.encodeURLProperty(url)}&cookieStoreId=${cookieStoreId}`;
708-
let currentCookieStoreId;
709-
if (currentUserContextId) {
710-
currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId);
708+
const currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId);
709+
if (parseInt(currentUserContextId, 10) > 0) {
711710
confirmUrl += `&currentCookieStoreId=${currentCookieStoreId}`;
712711
}
713712
return browser.tabs.create({

src/js/background/backgroundLogic.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const backgroundLogic = {
3232
if (!cookieStoreId) {
3333
return false;
3434
}
35+
if (cookieStoreId === "firefox-default") {
36+
return "0";
37+
}
3538
const container = cookieStoreId.replace("firefox-container-", "");
3639
if (container !== cookieStoreId) {
3740
return container;
@@ -357,7 +360,7 @@ const backgroundLogic = {
357360
},
358361

359362
cookieStoreId(userContextId) {
360-
if(userContextId === 0) return "firefox-default";
363+
if (parseInt(userContextId, 10) === 0) return "firefox-default";
361364
return `firefox-container-${userContextId}`;
362365
}
363366
};

0 commit comments

Comments
 (0)