Don't use hard coded browser name prefix 1
This commit is contained in:
parent
6f4d3c4327
commit
a804b75f09
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
const DEFAULT_TAB = "about:newtab";
|
const DEFAULT_TAB = "about:newtab";
|
||||||
|
const BROWSER_NAME = (await browser.runtime.getBrowserInfo()).name.toLowerCase();
|
||||||
const backgroundLogic = {
|
const backgroundLogic = {
|
||||||
NEW_TAB_PAGES: new Set([
|
NEW_TAB_PAGES: new Set([
|
||||||
"about:startpage",
|
"about:startpage",
|
||||||
|
@ -19,7 +20,7 @@ const backgroundLogic = {
|
||||||
if (!cookieStoreId) {
|
if (!cookieStoreId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const container = cookieStoreId.replace("firefox-container-", "");
|
const container = cookieStoreId.replace(BROWSER_NAME + "-container-", "");
|
||||||
if (container !== cookieStoreId) {
|
if (container !== cookieStoreId) {
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
@ -324,6 +325,6 @@ const backgroundLogic = {
|
||||||
},
|
},
|
||||||
|
|
||||||
cookieStoreId(userContextId) {
|
cookieStoreId(userContextId) {
|
||||||
return `firefox-container-${userContextId}`;
|
return BROWSER_NAME + `-container-${userContextId}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue