fix can't open in default container if url assigned to a container
associate userContextId=0 with CookieStoreId="firefox-default"
This commit is contained in:
parent
4b56a2f0bb
commit
ab5d67eacb
2 changed files with 6 additions and 4 deletions
|
@ -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({
|
||||
|
|
|
@ -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}`;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue