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});
|
return browser.tabs.create({url, cookieStoreId, index, active, openerTabId});
|
||||||
} 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 += `¤tCookieStoreId=${currentCookieStoreId}`;
|
confirmUrl += `¤tCookieStoreId=${currentCookieStoreId}`;
|
||||||
}
|
}
|
||||||
return browser.tabs.create({
|
return browser.tabs.create({
|
||||||
|
|
|
@ -32,6 +32,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;
|
||||||
|
@ -357,7 +360,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}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue